Created
May 21, 2013 01:28
-
-
Save lydonchandra/5616947 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Parent-window.html | |
this.$el.append('<iframe id="iframeDocument" src="/Iframe.html"></iframe>'); | |
loadIframe = function() { | |
var $iframeDocument = $('#iframeDocument').get(0).contentWindow.document; | |
$('#iframeContent', $iframeDocument).append( myHtml ); | |
} | |
Iframe.html | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Info List</title> | |
<script type="text/javascript"> | |
var $ = parent.window.$; | |
if( ! $ ) { | |
alert('Error! jQuery does not exist'); | |
} | |
function callParentWindow( arg1 ) { | |
// Call info1Jump in the main window | |
parent.window.func1( arg1 ); | |
$('div#content', parent.window.document).dialog('close'); | |
return false; | |
} | |
window.onload = function() { | |
parent.window.loadIframe(); | |
} | |
</script> | |
</head> | |
<body> | |
<div id="iframeContent"> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment