-1

Possible Duplicate:
open and close javascript window

Is it possible to open a new window using location.href=""? If so, how?

Community
  • 1
  • 1
Thilakraj
  • 41
  • 1
  • 8

2 Answers2

1

No, setting the location of the window can only be used to load a new page in the same window.

To open a new window you use the open method with a target _blank:

window.open('http://www.guffa.com', '_blank');
Guffa
  • 666,277
  • 106
  • 705
  • 986
0

To open a new browser window, use the window.open() method. For example, the following code opens this page in a new window.

myRef = window.open(''+self.location,'mywin',
'left=20,top=20,width=500,height=500,toolbar=1,resizable=0');

http://www.javascripter.net/faq/openinga.htm

rOcKiNg RhO
  • 631
  • 1
  • 6
  • 16