Skip to content

Instantly share code, notes, and snippets.

@stormsilver
Created May 27, 2010 16:26
Show Gist options
  • Select an option

  • Save stormsilver/416012 to your computer and use it in GitHub Desktop.

Select an option

Save stormsilver/416012 to your computer and use it in GitHub Desktop.
load('dist/env.rhino.js');
Envjs({
scriptTypes : {
'' : true,
'text/javascript' : true
},
logLevel : Envjs.DEBUG
});
window.location = "http://localhost/iframetest/parent.html";
Envjs.wait();
print(document.innerHTML);
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Integrator</title>
<script type="text/javascript">
function doit()
{
window.parent.print("doit");
}
</script>
</head>
<body onload="print('i got it');doit();">
<script type="text/javascript">
print("fooooo");
</script>
</body>
</html>
<html>
<head>
<title>Parent Window</title>
<script type="text/javascript">
var xhr_bridge = null;
function makeiframe()
{
setTimeout(function(){print("timeout exceeded");}, 2000);
xhr_bridge = document.createElement("iframe");
xhr_bridge.style.display = 'none';
xhr_bridge.src = 'http://localhost/iframetest/iframe.html';
document.body.appendChild(xhr_bridge);
}
</script>
</head>
<body>
<script type="text/javascript">
makeiframe();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment