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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript runtime error

Status
Not open for further replies.

Mariootje

Programmer
Aug 10, 2001
33
NL
Hello,

Has anybody got experience working with javascript and asp (vbscript)? I am designing a page which builds up a table. If you click on a link in the table some extra information should arise (like a windows builing tree). The code, in pure js, without the asp part works fine, but now when I am trying to combine asp and js it is not working out. The code looks as follows:

call subHtmlhead
Response.Write(&quot;<table width='100%' border='1'>&quot;)
while not oRs.Eof
call subHtmltable
oRs.movenext
wend
Response.Write(&quot;</table></body></html>&quot;)

<%
sub subHtmlhead
'***********************************************************
'*Omschrijving: Samenstellen Head in HTML pagina
'***********************************************************%>
<html>
<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=windows-1252&quot;>
<meta name=&quot;GENERATOR&quot; content=&quot;Microsoft FrontPage 4.0&quot;>
<meta name=&quot;ProgId&quot; content=&quot;FrontPage.Editor.Document&quot;>
<title>onload</title>

<script language=&quot;javascript&quot;>

var Open = &quot;&quot;
var Closed = &quot;&quot;
<!--
function preload(){
if(document.images){
Open = new Image()
Closed = new Image()
Open.src = &quot;images/minnetje.gif&quot;
Closed.src = &quot;images/plusje.gif&quot;
}
}

function showhide(what, what2){
if (what.style.display==&quot;none&quot;){
what.style.display=&quot;&quot; /*shows what is being shown*/
what2.src=Open.src /*shows an open or closed folder*/
}
else{
what.style.display=&quot;none&quot;
what2.src=Closed.src
}
}
-->
</script>
</head>

<body onLoad=&quot;preload()&quot;>
<%
end sub
%>

<%
sub subHtmltable
'***********************************************************
'*Omschrijving: Samenstellen van de pagina
'***********************************************************
%>
<tr>
<td valign=&quot;top&quot; align=&quot;right&quot; width=&quot;3%&quot; rowspan=&quot;2&quot;><font face=&quot;Verdana&quot; size=&quot;2&quot;>
<span id=&quot;menu1&quot; onClick=&quot;showhide(menu1outline,menu1sign)&quot;><img id=&quot;menu1sign&quot; src=&quot;../images/plusje.gif&quot;></span>
</font>
</td>
<td width=&quot;15%&quot; valign=&quot;top&quot;><%= oRs.fields(&quot;Zaakid&quot;)%>
</td>
<td width=&quot;82%&quot;><%= oRs.fields(&quot;Citeertitel&quot;)%>
</td>
</tr>
<tr>
<td colspan=&quot;2&quot;>
<span id=&quot;menu1outline&quot; style=&quot;display:'none'&quot;>Adviesopmerking<br>
Tekst over de eerste advies opmerking</span>
</td>
</tr>
<%
end sub
%>

When I click a folder to open I get an runtime error which tells me that style.object is not an object or is null.

Hope anybody has got any experience with this sort of problem!

Mario
 
A couple things: When using css you don't need quotes, its just

display:none;
not
display:'none';

That should fix your error --

Also, document.getElementById(&quot;id&quot;).style.display = &quot;none&quot;;

etc. is the standardized way of grabbing the value -- so make sure you inlcude that in there somewhere!! =) ===
Supports Mozilla and Web Standards
Knows HTML/XHTML, CSS1, JavaScript, PHP, C++, DOM1
===
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top