0
$('div#content a').attr('target', 'forceToIframeWindow');
$(document).on("click", 'div#content a', function(){
var thisSrc = $(this).attr("href");
$(document.body).append(
$('<iframe />').attr({
"name":"forceToIframeWindow",
"src":thisSrc
}))
});
DOM看起来像这样不开放,在这里是工作环节:如果你想防止某些链接在IFRAME
<p><a href="http://example.com" target="forceToIframeWindow"><img src="test.jpg"></a></p>
这可以工作。我发现只是增加了返回错误的作品。 –