Forum Moderators: open

Message Too Old, No Replies

Problem with an onload function

         

Magpie

8:18 am on Feb 23, 2005 (gmt 0)

10+ Year Member



Hey there... Since about last May (04), on my website, when the main page loads up I often have it automatically bring up a pop up to advertise an important gig. When we do not have a gig I take it off... This is the code I have been using:

<script language="JavaScript"> for="window" event="onload()">
<!--
window.open
("sggig.htm","vb","height=307,width=230")
//-->
</script>

Now this has never given me a problem up until now... It just simply isnt working anymore... is there something im doing wrong?

All help is much appreciated

Martin

dcrombie

10:15 am on Feb 23, 2005 (gmt 0)



Most browsers now have the option of blocking the creation of pop-ups and similar items that try to open automatically (onLoad). They should still work if the trigger is a user action (ie. onClick).

Magpie

11:14 am on Feb 23, 2005 (gmt 0)

10+ Year Member



Its not that it is blocking the pop up window... When it loads up it says the page has finished loading but with errors on the page...

This is the error message IE gives me is:

Line: 146
Char: 5
Error: Expected '('
Code: 0
URL: [....com...]

Martin

syktek

1:59 pm on Feb 23, 2005 (gmt 0)

10+ Year Member



this code works for me

<script language="JavaScript" type="text/JavaScript">
window.open("http://www.webmasterworld.com","forums","width=307,height=230");
</script>

checked in latest versions of IE and Firefox on PC and Mac...

Magpie

2:33 pm on Feb 23, 2005 (gmt 0)

10+ Year Member



A-ha! It works!

Thanks for that mate!

Kind regards

Martin