Last active
April 4, 2024 22:05
-
-
Save lambdamusic/4734350 to your computer and use it in GitHub Desktop.
JavaScript: JS: open popup window #js
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
// construct for explorer compatibility | |
var newwindow = ''; | |
// EG: pop_up_window("http://www.google.com", 200, 200) | |
function pop_up_window(url, sizeh, sizew) { | |
if (!newwindow.closed && newwindow.location) { | |
newwindow.location.href = url; | |
} | |
else { | |
newwindow=window.open(url,'name','height=' + sizeh + ', width=' + sizew + ', status=1, resizable=1, location=1, scrollbars=1 '); /*resizable=1*/ | |
if (!newwindow.opener) newwindow.opener = self; | |
newwindow.moveTo(100,100); | |
} | |
if (window.focus) {newwindow.focus()} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment