vijay Posted March 7, 2008 Share Posted March 7, 2008 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 More sharing options...
aspnetguy Posted March 7, 2008 Share Posted March 7, 2008 try adding more arguments to the function window.open('http://www.google.com','OpenGoogleWindow','width=800,height=600'); Link to comment Share on other sites More sharing options...
Guest FirefoxRocks Posted March 7, 2008 Share Posted March 7, 2008 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 More sharing options...
aspnetguy Posted March 7, 2008 Share Posted March 7, 2008 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 thisfunction 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.