nicklin@hotmail.com (Nick) writes:
[color=blue]
> I can't make out why this won't work[/color]
What doesn't work? Does nothing happen or does the wrong thing happen?
[color=blue]
> in iexplorer (even when I change 'Netscape'). The mouse over works
> fine in >Netscape 4 and Opera 5 and 7. Is it a simple fix or is that
> wishful thinking?[/color]
[color=blue]
> <script language="JavaScript">[/color]
The type attribute is required in HTML 4.0+
<script type="text/javascript">
[color=blue]
> <!--[/color]
HTML comments are not needed in Javascript.
[color=blue]
> function bboatssw_exchange_src(name, rpath, nsdoc)
> {[/color]
[color=blue]
> str = (navigator.appName == 'Netscape') ? nsdoc+'.'+name :
> 'document.all.'+name;
> img = eval(str);[/color]
Declare your variables as local to avoid polluting the global
namespace.
You never need eval to access object properties or variables.
These two lines can be changed to just:
var img = document.images[name];
It works in pretty much any browser later than Netscape 2.
/L
--
Lasse Reichstein Nielsen -
lrn@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'