JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 25th, 2001, 12:52 PM
JMM JMM is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Location: USA
Posts: 830 JMM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 17 m 56 sec
Reputation Power: 13
Netscape refuses to cooperate with my JavaScript

I have a page where, midway through the code there is a JavaScript statement that should change one of the images displayed on the page, similar to performing a rollover, but just executed as the page is being rendered in this case, not in reponse to an event. Here is the statement:

Code:
eval( "document.images[ '" + window.currentPage + "' ].src = window." + window.currentPage + "_on.src;" );


This works in IE but does nothing in Netscape (no action, no error). The annoying thing about it is that an exactly equivalent statement works to perform rollovers on the page. Here is that code:

Code:
eval( "document.images[ '" + slice + "' ].src = window." + slice + "_" + dir + ".src;" );


The part of the statement that is
Code:
+ "_" + dir + ".src;"
in the second statement is hardwired as
Code:
+ "_on.src;"
in the first statement.

Is this just (yet another) case of Netscape being arbitrarily defective?

Reply With Quote
  #2  
Old July 25th, 2001, 01:26 PM
JMM JMM is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Location: USA
Posts: 830 JMM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 17 m 56 sec
Reputation Power: 13
Nevermind. I resolved the issue by moving the problematic JavaScript code further down in my HTML code which, for no reason, made it work.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Netscape refuses to cooperate with my JavaScript

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap