Created
January 11, 2015 12:59
-
-
Save 0xffan/5cbcb94f05062cd5b54c to your computer and use it in GitHub Desktop.
Communication
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
var popupWindow = window.open("popupWindow.html", "WindowName", "width=100, height=30, menubar=no, resizable=no, scrollbars=no"); | |
whenPopupClosed(popupWindow, callback); | |
var whenPopupClosed = function (popupWindow, callback) { | |
var pollTimer = window.setInterval(function() { | |
if (popupWindow.closed !== false) { // !== is required for compatibility with Opera | |
window.clearInterval(pollTimer); | |
callback(); | |
} | |
}, 200); | |
}; | |
function whenPopupClosed() { | |
img = window.opener.document.getElementById("imgPreview"); | |
img.src = "http://fc01.deviantart.net/fs71/i/2013/201/5/e/purple_minion_by_sebastianavi-d6ea5a9.jpg"; | |
//window.opener.location.reload(); | |
window.close(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment