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

Javascript menu not working

Status
Not open for further replies.

Lbob

Programmer
May 23, 2003
157
GB
Hi

I've got a javascript menu on my intranet site that works on all the pages except one and I don't know why! I just get an I just get an expected end of statement error. Can anyone help me?!

<html>
<head>
<xml id=&quot;oXML&quot;></xml>
<script language=&quot;VBScript&quot;>
Option Explicit
Dim rs
Sub PopulateSubTree(oTreeNode, oXMLNode)

Dim oNewTreeNode
Dim oXMLSubNode
Dim new_key

Const tvwChild = 4

' add the current node to the tree
new_key = &quot;_&quot; & oXMLNode.selectSingleNode(&quot;@id&quot;).nodevalue
set oNewTreeNode = TreeView1.Nodes.Add(oTreeNode.key, tvwChild,new_key, oXMLNode.selectSingleNode(&quot;@name&quot;).nodeValue)

' recursively call the sub to add any children
for each oXMLSubNode in oXMLNode.selectNodes(&quot;user&quot;)
Call PopulateSubTree(oNewTreeNode, oXMLSubNode)
next

oNewTreeNode.Expanded = true

End Sub

Function PopulateTree()

Dim oRoot

with oXML.XMLDocument
.async = false
if .load(&quot;el_supremo.xml&quot;) Then
set oRoot = TreeView1.Nodes.Add(,,&quot;_-1&quot;,&quot;AWOL&quot;)
oRoot.Expanded = true
call PopulateSubTree(oRoot, oXML.SelectSingleNode(&quot;/xml/user&quot;))
else
msgbox &quot;Couldn't load xml file because &quot; & .parseError.reason
End if
end with

End Function

</script>
</head>
<body onload=&quot;VBScript:populateTree&quot;>
<SCRIPT language=&quot;JavaScript&quot; src=&quot;jscript/admin_menu_array.js&quot; type=&quot;text/javascript&quot;></SCRIPT>
<SCRIPT language=&quot;JavaScrip&quot;t src=&quot;jscript/mmenu.js&quot; type=&quot;text/javascript&quot;></SCRIPT>
<table height=&quot;25&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;600&quot;>
<tr align=&quot;left&quot;>
<FONT color=#ffffff><B></B></FONT><td align=&quot;left&quot; bgcolor=&quot;#333366&quot;><IMG align=bottom border=0 src=&quot;graphics/a.gif&quot;></td>
<td align=&quot;right&quot; bgcolor=&quot;#333366&quot;><font color=&quot;#ffffff&quot; SIZE=&quot;3&quot;><b>XXX</b></font></td></tr>
</table>
<br>
<br>
<br>
<font size=4 color=&quot;#ff6702&quot;>Team Structure</font>
<br>
<br>
<OBJECT classid=&quot;clsid:C74190B6-8589-11D1-B16A-00C0F0283628&quot; height=345 id=TreeView1
style=&quot;FONT-FAMILY: tahoma; FONT-SIZE: 11px; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal; HEIGHT: 345px; LEFT: 0px; TOP: 0px; WIDTH: 600px&quot;
width=600>
<PARAM NAME=&quot;_ExtentX&quot; VALUE=&quot;15875&quot;>
<PARAM NAME=&quot;_ExtentY&quot; VALUE=&quot;9128&quot;>
<PARAM NAME=&quot;_Version&quot; VALUE=&quot;393217&quot;>
<PARAM NAME=&quot;HideSelection&quot; VALUE=&quot;0&quot;>
<PARAM NAME=&quot;Indentation&quot; VALUE=&quot;741&quot;>
<PARAM NAME=&quot;LabelEdit&quot; VALUE=&quot;1&quot;>
<PARAM NAME=&quot;LineStyle&quot; VALUE=&quot;0&quot;>
<PARAM NAME=&quot;PathSeparator&quot; VALUE=&quot;\&quot;>
<PARAM NAME=&quot;Sorted&quot; VALUE=&quot;1&quot;>
<PARAM NAME=&quot;Style&quot; VALUE=&quot;6&quot;>
<PARAM NAME=&quot;Checkboxes&quot; VALUE=&quot;0&quot;>
<PARAM NAME=&quot;FullRowSelect&quot; VALUE=&quot;0&quot;>
<PARAM NAME=&quot;HotTracking&quot; VALUE=&quot;0&quot;>
<PARAM NAME=&quot;Scroll&quot; VALUE=&quot;1&quot;>
<PARAM NAME=&quot;SingleSel&quot; VALUE=&quot;0&quot;>
<PARAM NAME=&quot;ImageList&quot; VALUE=&quot;&quot;>
<PARAM NAME=&quot;BorderStyle&quot; VALUE=&quot;1&quot;>
<PARAM NAME=&quot;Appearance&quot; VALUE=&quot;1&quot;>
<PARAM NAME=&quot;MousePointer&quot; VALUE=&quot;0&quot;>
<PARAM NAME=&quot;Enabled&quot; VALUE=&quot;1&quot;>
<PARAM NAME=&quot;OLEDragMode&quot; VALUE=&quot;0&quot;>
<PARAM NAME=&quot;OLEDropMode&quot; VALUE=&quot;0&quot;></OBJECT>
<BR>
<BR>
</body>
</html>


 
>> I've got a javascript menu

No you haven't: [tt]<script language=&quot;VBScript&quot;>[/tt]

The good people at the VBScript forum might be better equipped to help you - forum329


Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
 
Yes I have, if you look a bit further down!

<SCRIPT language=&quot;JavaScript&quot; src=&quot;jscript/admin_menu_array.js&quot; type=&quot;text/javascript&quot;></SCRIPT>
<SCRIPT language=&quot;JavaScrip&quot;t src=&quot;jscript/mmenu.js&quot; type=&quot;text/javascript&quot;></SCRIPT>
 
Hi Lbob,

It seems that your tag is not correct :


<SCRIPT language=&quot;JavaScrip&quot;t src=&quot;jscript/mmenu.js&quot; type=&quot;text/javascript&quot;></SCRIPT>


&quot;JavaScrip&quot;t ??
 
oops,changed it and it still doesn't work!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top