loading html content into iframe fails in Chrome
I have made an HTML page with the following jQuery script.
function clickbutton() {
frameContent = $('#iframeID').contents().find('body').html();
$("#paste").html(frameContent);
}
And the following HTML:
This 开发者_JAVA技巧is a page with an IFRAME.<br>
<IFRAME id="iframeID" src="otherpage.html" height="600" width="600"></IFRAME><br>
<input type="button" value="click" onclick="clickbutton()"/><br>
<div id="paste"></div>
The script reads the content of the otherpage.html
when the button is clicked.
This works perfectly in IE and Firefox, but not in Chrome.
Why is this not working in Chrome, and are there any workarounds?
this seems to work for me: http://www.jsfiddle.net/d6SNB/2/
精彩评论