HomeMathComputingArtsWordsLiteratureMusictwitter facebook webfeed

Pop-up popup A New Window with Javascript

Advertise Here For Profit

Xah Lee, 2005-11, 2010-10-21

Here's a example of popping up a window.

to popup a window.

Here's the code:

<p><button id="x0cd33" class="x03c89">Click Me</button> to popup a window.</p>
function f1() {
 // window.open(URL,name,spec)
  var myWinObj = window.open( "pop_me.html", "poetry",
   "width=400,height=300,left=100");
  myWinObj.focus();
}

document.getElementById("x0cd33").onclick = f1;

If you have your browser set to open new window in tab, the pop-up will be just a new tab.

https://developer.mozilla.org/en/DOM/window.open

blog comments powered by Disqus