Jump to content

window.open in safari - urgent


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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...