我可以使用JavaScript将html传递给脚本标记吗?

时间:2015-03-13 22:31:34

标签: jquery

是否可以将html传递给标签?例如,我可以放$("script.receiver")html("something to go in the script tag");

1 个答案:

答案 0 :(得分:0)

它不适用于已有的脚本,因为它已经执行,但您可以添加新的script,例如:

$("body").append("<script>alert(1)</script>");