
July 25th, 2001, 12:52 PM
|
|
Contributing User
|
|
Join Date: Feb 2001
Location: USA
Posts: 830
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 in the first statement.
Is this just (yet another) case of Netscape being arbitrarily defective?
|