Welcome to WebmasterWorld Guest from 54.198.246.116

Forum Moderators: incrediBILL

Message Too Old, No Replies

Using onClick to load new page NS + IE

     

neil laurance

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

Inactive Member
Account Expired

 
 


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 July 26, 2001 (gmt 0)

Junior Member

10+ Year Member

joined:July 20, 2001
posts:137
votes: 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 July 26, 2001 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 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 July 26, 2001 (gmt 0)

Junior Member

10+ Year Member

joined:July 20, 2001
posts:137
votes: 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 July 27, 2001 (gmt 0)

Inactive Member
Account Expired

 
 


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

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members