Created
May 23, 2013 12:41
-
-
Save fedir/5635765 to your computer and use it in GitHub Desktop.
Change iframe contents with jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('iframe').contents().find('html').html(data); |
// Pure JS alternative solution
var doc = iframe.contentDocument ? iframe.contentDocument : (iframe.contentWindow.document || iframe.document);
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// Pure JS version
var d = someFrame.contentWindow.document;
d.write(data);
d.close();