不灭的焱

革命尚未成功,同志仍须努力下载JDK17

作者:Albert.Wen  添加时间:2022-07-31 20:12:47  修改时间:2024-03-27 23:48:18  分类:前端/Vue/Node.js  编辑

在jQurry中要动态执行从服务器端返回的Html片断,可用jQurry中的globalEval()方法。

举例如下:

let scriptCode='alert("hello")';
$.globalEval(scriptCode);

 

参考:https://www.runoob.com/jquery/misc-globaleval.html