homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

Using onClick to load new page NS + IE
neil laurance

 1:21 pm on Jul 26, 2001 (gmt 0)

Hi Folks,

I am currently working on making legacy Javascript code written for IE work also on Netscape (v6)

Most of the code seems fine, as the amount of DHTML is minimal. However, the following code snippet works with IE and not NS:

<input type="button" value="Log on" onClick="open('../cgi/mycgi.pl?VAL1=xxx&VAL2=yyy', '_top', 'menubar,toolbar,location,scrollbars,resizable,status')">

However, replacing this with the following code works fine with both browsers:

<input type="button" value="Log on" onClick="location='../cgi/mycgi.pl?VAL1=xxx&VAL2=yyy'">

My question is: is there anything obviuosly wrong with the first method, or is this something quirky as to how Netscape deals with 'open'

Thanks for any insight. Cheers, Neil



 3:21 pm on Jul 26, 2001 (gmt 0)

Normally you should explicitly provide the window object when in an event handler. I'm not sure if this applies to inline handlers, but its worth a try.

<input type="button" value="Log on" onClick="window.open(...)">


 5:30 pm on Jul 26, 2001 (gmt 0)

I think you're right, Mike. Without the "window", Netscape assumes this is a document.open(), but the arguments in this particular code are for a window.open()

I didn't realize that IE would assume "window". That's not standard js functioning, at least according to my references.


 7:12 pm on Jul 26, 2001 (gmt 0)

Yep, I think you're right tedster. I also didn't realize that IE would assume the window object in this case.

Hi neil_laurance, did that work?

neil laurance

 9:40 am on Jul 27, 2001 (gmt 0)

Yep. Putting window.open worked for NS and IE. Thanks for the advice. Cheers, Neil

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved