Created
May 4, 2016 17:50
-
-
Save FrankHouweling/cd43554afc305e03cc62c11e5e96b8fb 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> | |
<head> | |
<script type="text/javascript"> | |
var func = function() { | |
var parent = window; // pointer to parent window | |
var child = childWindow; | |
return function() { | |
parent.alert('Attached to main window') | |
child.alert('Attached to child window') | |
} | |
}(); | |
childWindow.func = func; // pass function to child window | |
</script> | |
</head> | |
<body onready="do();"> | |
Hi! | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment