Skip to content

Instantly share code, notes, and snippets.

@lambdamusic
Last active April 4, 2024 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lambdamusic/4734350 to your computer and use it in GitHub Desktop.
Save lambdamusic/4734350 to your computer and use it in GitHub Desktop.
JavaScript: JS: open popup window #js
// 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