-
-
Save savetheclocktower/b57071237417d8743f88 to your computer and use it in GitHub Desktop.
Test case for #82 (https://github.com/sstephenson/prototype/pull/82). Place both files into the `test` directory in the Prototype source code.
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 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>Prototype Console</title> | |
<script src="../dist/prototype.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
if (window.top && window.top !== window) { | |
window.top.Foo.bar('from iframe'); | |
} else if (parent && parent.opener) { | |
parent.opener.Foo.bar('from popup'); | |
} | |
</script> | |
</body> | |
</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 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>Prototype Console</title> | |
<script src="../dist/prototype.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
var Foo = { | |
variable: 9, | |
bar: function(description) { | |
[1].each(function() { | |
console.log(description, 'this:', this, 'this.variable:', this.variable); | |
}, this); | |
} | |
}; | |
</script> | |
<iframe src="iframe.html"></iframe> | |
<button id="open_window">Open window</button> | |
<script type="text/javascript"> | |
$('open_window').on('click', function () { window.open('iframe.html'); }); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment