views:

150

answers:

5

Hi , how can i open a page in new window in using javascript.

+2  A: 

window.open

JoshBerke
+1  A: 

Try with this piece of code:

window.open("http://www.google.com");

That's if you want to open a new window.

Good luck.

Pablo Santa Cruz
+1  A: 

You can use this:

<script language="javascript" type="text/javascript">
<!--
function popitup(url) {
    newwindow=window.open(url,'name','height=200,width=150');
    if (window.focus) {newwindow.focus()}
    return false;
}

// -->
</script>

You can call it like this:

<a href="something.html" onclick="return popitup('something.html')">Link to popup</a>
karim79
+1  A: 

Refer to http://www.javascript-coder.com/window-popup/javascript-window-open.phtml

You can attach the code as a client-side event on a button.

Anthony
A: 

or you can use plain old html and the target attribute. <a href="link.html" target="_blank">

Chad Grant