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>
這可以工作。我發現只是增加了返回錯誤的作品。 –