Jump to content

window.open in safari - urgent


vijay

Recommended Posts

Hi.. following code is working in IE as well as in FF file It will load the google home page via window.openbut its not working in safari.. do the needful help..<script language="javascript" type="text/javascript">window.open('http://www.google.com');</script>I wont to open new window @ the time of page loading...Regards,Vijay

Link to comment
Share on other sites

Guest FirefoxRocks

Try this code:

<script type="text/javascript"><!--//--><![CDATA[//><!--function newWindow(){window.open('http://www.google.com');}//--><!]]></script>

In your <body> tag:

<body onload="newWindow()">

This may also be an issue with the pop-up blocker.

Link to comment
Share on other sites

Try this code:
<script type="text/javascript"><!--//--><![CDATA[//><!--function newWindow(){window.open('http://www.google.com');}//--><!]]></script>

In your <body> tag:

<body onload="newWindow()">

This may also be an issue with the pop-up blocker.

you can test for that like this
function newWindow(){  if(!window.open('http://www.google.com')) {	alert('Failed to open new window. Please disable your popup blocker or hold the CTRL key while you click the link');  }}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...