Last active
August 29, 2015 14:01
-
-
Save dherman/82ca22b2ecc506d01182 to your computer and use it in GitHub Desktop.
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
<!doctype html> | |
<script> | |
function go() { | |
var tgt = document.getElementById("tgt"); | |
var getSekrit = tgt.contentWindow.getSekrit; | |
var results1 = getSekrit(); | |
tgt.addEventListener('load', function() { | |
var results2 = getSekrit(); | |
alert(results1.concat(results2)); | |
}); | |
tgt.contentWindow.open("cc.html", "_self"); | |
} | |
</script> | |
<body onload=go()> | |
<iframe id="tgt" src="bb.html"></iframe> | |
</body> |
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
<!doctype html> | |
<script> | |
var sekrit = 42; | |
var getSekrit = (function(self) { | |
return function getSekrit() { | |
return [typeof self.sekrit, typeof sekrit]; | |
} | |
})(this); | |
</script> | |
bb.html |
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
<!doctype html> | |
cc.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment