gpt4 book ai didi

javascript - 未终止的字符串文字 jquery 或更多

转载 作者:行者123 更新时间:2023-11-30 09:03:29 25 4
gpt4 key购买 nike

嗯,我知道 jquery 以不同方式处理字符串的单引号和双引号。实际上我想做的是在点击链接时打开一个弹出窗口。

下面是我在点击“a”标签时附加到正文的内容:

$(".prop a").click(function() {
$("body").append("<div class='lang'>
<span class='propHead'>Security</span><a href='javascript:void(0);' class='cross' >X</a><div class='propText'>This will be having he description of each of the Language on whch you click with a link to pdf documentatiom</div><span class='propBtmText'><a href='javascript:void(0)';>Download Documentation</a></span>
</div>")

但我得到未终止的字符串文字。我发现我已将 div 和 span 正确附加到正文,但它不起作用。

非常感谢任何帮助。

最佳答案

Demo

代码似乎没问题。如果您使用的内容过于冗长,则 javascript 不喜欢多行字符串,因此您需要改用它:

$("body").append("<div class='lang'><span class='propHead'>Security</span><a href='javascript:void(0);' class='cross' >X</a><div class='propText'>This will be having he description of each of the Language on whch you click with a link to pdf  documentatiom</div><span class='propBtmText'><a href='javascript:void(0)';>Download Documentation</a></span></div>")

关于javascript - 未终止的字符串文字 jquery 或更多,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7184487/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com