Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"document[name] has no properties" error in netscape

Status
Not open for further replies.

hablablow

Programmer
Sep 9, 2000
115
FR

I mixed different Js together in order to have visual effects on my page.
They perfectly work separately.
The problem appears in netscape on a rollover effect when i mix them.
The communicator console shows me this message:

"document[name] has no properties"

The script i use for the rollover is quite simple, it goes like this:
---------------------------------------------------------------------------------------------------
<SCRIPT LANGUAGE=&quot;javascript&quot;>
var NN3 = false;
image1= new Image();
image1.src = &quot;popup/uneed.gif&quot;;
image1on = new Image();
image1on.src = &quot;popup/uneed.gif&quot;;
image1alt = new Image();
image1alt.src = &quot;popup/bm1.gif&quot;;
image1alton = new Image();
image1alton.src = &quot;popup/bm1_what_roll.gif&quot;;
function on3(name) {
document[name].src = eval(name + &quot;on.src&quot;);
document[&quot;hbl&quot;].src = eval(name + &quot;alton.src&quot;);
}
function off3(name) {
document[name].src = eval(name + &quot;.src&quot;);
document[&quot;hbl&quot;].src = eval(name + &quot;alt.src&quot;);
}
NN3 = true;
function on(name) {
if (NN3) on3(name);
}
function off(name) {
if (NN3) off3(name);
}
</SCRIPT>

Then are coming my comands in cells of a table

<A HREF=&quot;#&quot;><IMG SRC=&quot;popup/bm1.gif&quot; NAME=&quot;hbl&quot; BORDER=&quot;0&quot; WIDTH=&quot;221&quot; HEIGHT=&quot;34&quot;></A>
<A HREF=&quot;#&quot; ONMOUSEOVER=&quot;on('image1');&quot; ONMOUSEOUT=&quot;off('image1')&quot;>
<IMG SRC=&quot;popup/uneed.gif&quot; ONLOAD=&quot;&quot; BORDER=&quot;0&quot; NAME=&quot;image1&quot; WIDTH=&quot;35&quot; HEIGHT=&quot;34&quot;></A>

I don't know why netscape is not accepting it.
If somedy knows, would be great.
 
The syntax (for NN/IE) needs to be:-

document.images[name].src

Should solve the problem.

Enjoy :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top