Click to See Complete Forum and Search --> : js+asp problem


pelegk1
10-20-2003, 09:16 AM
i have this code
<tr id="trMostViewed">
<td bgcolor="<%=Application("RightBarTitlesColor")%>" HEIGHT="20" width="100%"><font color="White"><b>&nbsp; most viewed </b></font></td>
<td><img border="0" SRC="/images/corner.gif"></td>
</tr>
<tr>
<td>
<!-- #include File="Viewed.asp" -->
<br></td>
</tr>

in the viewed.asp file i have this code :
<%
if rstDoc.EOF=true then Response.Write "<SCRIPT> if (document.all['trMostViewed']) { document.all['trMostViewed'].style.visibility='none')} </SCRIPT>"
%>

but i am getting an error which says :
document.all.trMostViewed.style.visibility
is not an object!!!

why is that?how can i fix it?

pelegk1
10-21-2003, 01:48 AM
helppppppppppp

Gollum
10-21-2003, 02:05 AM
You'll probably want to use document.getElementById('trMostViewed') instead of document.all[...]

pelegk1
10-21-2003, 02:09 AM
it steal dosent effect :

document.getElementById(""trMostViewed"").style.display='none';

i want it to make the trMostViewed invisible but it isnt working why?

simpson97
10-21-2003, 02:24 AM
Try changing this line
['trMostViewed']) { document.all['trMostViewed'].style.visibility='none')}

to

['trMostViewed']) { document.all['trMostViewed'].style.visibility='hidden'}

Bob

pelegk1
10-21-2003, 02:28 AM
but why didnt the display worked?

simpson97
10-21-2003, 03:29 AM
First off 'none' doesnt work in IE 'hidden' does .
Also you had a round right bracket a end of line.
'trMostViewed']) { document.all['trMostViewed'].style.visibility='none')}

I assume you are browsing sniffing to tailor script to multiple browsers ie: layers for Netscape.

Bob

pelegk1
10-21-2003, 03:34 AM
with the visibility!
and second i dwork only with IE and not with netscape !
and third whyshould my broswer sniff something?