Skip to content

Instantly share code, notes, and snippets.

@ludo6577
Last active August 29, 2015 14:11
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 ludo6577/e276141633eeeeeef2e6 to your computer and use it in GitHub Desktop.
Save ludo6577/e276141633eeeeeef2e6 to your computer and use it in GitHub Desktop.
Javascript: Open / Close window
function close_popupWindow() {
window.self.opener = window.self;
window.self.close();
}
var wnd;
function open_popupWindow() {
var w = 700;
var h = 400;
var left = (screen.width / 2) - (w / 2);
var top = (screen.height / 2) - (h / 2);
wnd = window.open('../Pages/shareDialog.html', 'share', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
/*
* Set the text in the window
*/
setWindowContent();
return wnd;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment