Created
February 14, 2011 11:49
-
-
Save tobiastom/825765 to your computer and use it in GitHub Desktop.
Sample code to demonstrate communication between a javascript popup and it's opening window.
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 type="text/javascript"> | |
if ( window.name == 'popup' ) { | |
document.body.className += ' in-popup' | |
} | |
function selectItemInPopup(item) { | |
window.opener.popupDidSelectItem(window.item); | |
window.close(); | |
} | |
</script> | |
<a href="./546.html" onclick="selectItemInPopup(546); return false;">Item 546</a></li> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment