它起作用了
var tip = "<p>Most computers will open PDF documents automatically, but you may need to download <a title='Link to Adobe website-opens in a new window'";
tip +=" href='http://www.adobe.com/products/acrobat/readstep2.html' target='_blank'>Adobe Reader</a>.</p>";
if($("div#maincontent a[href*='.pdf']").length>0){
$("div#maincontent").children(":last-child").after(tip);但事实并非如此
var tip = "<p class="adobe-reader-download">Most computers will open PDF documents automatically, but you may need to download <a title='Link to Adobe website-opens in a new window'";
tip +=" href='http://www.adobe.com/products/acrobat/readstep2.html' target='_blank'>Adobe Reader</a>.</p>";
if($("div#maincontent a[href*='.pdf']").length>0){
$("div#maincontent").children(":last-child").after(tip);发布于 2010-04-24 20:35:02
您在此处使用了双引号,此处显示为adobe-reader-download
var tip = "<p class="adobe-reader-download">试试这个:
var tip = "<p class=\"adobe-reader-download\">注意:如果对整个字符串使用单引号,则不需要转义双引号。
https://stackoverflow.com/questions/2704454
复制相似问题