如果我通过 JavaScript 在页面中添加内容,搜索引擎蜘蛛可以抓取它并通过屏幕阅读器访问它。
例如这个
var tip = "<p>Most computers will open PDF documents ";
tip += "automatically, but you may";
tip += "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>";
$(document).ready(function(){
//IF NUMBER OF PDF LINKS IS MORE THAN ZERO INSIDE DIV WITH ID maincontent
//THEN THIS WILL PUT TIP PARAGRAPH AS LAST CHILD OF DIV
if($("div#maincontent a[href*='/pdf']").length>0){
$("div#maincontent").children(":last-child").after(tip);
}
});
编辑:我想从搜索引擎中隐藏它,但同时让屏幕阅读器可以访问它是否可能?