【发布时间】:2018-09-16 10:52:58
【问题描述】:
我有数百个 HTML 页面,我想为它们添加一个带有链接和样式的新 div,但编辑每个页面需要大量时间。
所有页面都有一个通用的 JavaScript 文件。
如何将下面的 div 附加或添加到所有页面?
<div style="background-color:#561D1B;" id="testid">
<marquee style="background-color:#561D1B;height:19px;"><script src="https://testurl.com/test" type="text/javascript" ></script></marquee>
</div>
avoid-fout 是一个类,我尝试添加以下代码,但它不起作用。
$(".avoid-fout").append("<div style="background-color:#561D1B;" id="testid">
<marquee style="background-color:#561D1B;height:19px;"><script src="https://testurl.com/test" type="text/javascript" ></script></marquee>
</div>");
【问题讨论】:
-
我试过了,但它不工作......看我的问题
-
你的脚本src真的是一个有效的js吗???
标签: javascript jquery html css