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

Expected end of line error

Status
Not open for further replies.

Dvarkholm

Technical User
Sep 5, 2002
17
0
0
GB
I can't believe the hassle I'm getting with vbscript. Please would someone tell me what on earth is wrong with the following code as I keep getting the error: line 53 expected end of line.

<HTML>
<HEAD>
<LINK REL=&quot;StyleSheet&quot; HREF=&quot;index.css&quot; TYPE=&quot;text/css&quot; MEDIA=&quot;screen&quot;></LINK>
<SCRIPT LANGUAGE=&quot;VBScript&quot;>
<!--
Option Explicit ' all variables must be declared.

'===================================================
'
'===================================================
function MouseOver(ButtonName)
select case ButtonName
case &quot;Back&quot; document.Back.src = &quot;backbo.jpg&quot;
case &quot;CheckAll&quot; document.CheckAll.src = &quot;checkallbo.jpg&quot;
case &quot;UnCheckAll&quot; document.UnCheckAll.src = &quot;uncheckallbo.jpg&quot;
case &quot;Install&quot; document.Install.src = &quot;installbo.jpg&quot;
end select
end function

'===================================================
'
'===================================================
function MouseOut(ButtonName)
select case ButtonName
case &quot;Back&quot; document.Back.src = &quot;backb.jpg&quot;
case &quot;CheckAll&quot; document.CheckAll.src = &quot;checkallb.jpg&quot;
case &quot;UnCheckAll&quot; document.UnCheckAll.src = &quot;uncheckallb.jpg&quot;
case &quot;Install&quot; document.Install.src = &quot;installb.jpg&quot;
end select
end function

function saveForm()
end function

function saveCookie(product)
end function

function checkall()
end function

function uncheckall()
end function

function productSelected()
end function
-->
</SCRIPT>
</HEAD>
<BODY>
<IMG src=&quot;leftmain.jpg&quot; class=&quot;Logo&quot;>
<IMG SRC=&quot;Title2.jpg&quot; class=&quot;Title&quot;>
<IMG SRC=&quot;rightmain.jpg&quot; class=&quot;right&quot;>

<a href=&quot;&quot; class=&quot;barbutton1&quot; onmouseover=&quot;MouseOver('Back')&quot; onmouseout=&quot;MouseOut('Back')&quot; onmousedown=&quot;saveForm(); saveCookie('Products'); location='index.html'&quot;><img src=&quot;backb.jpg&quot; width=&quot;122&quot; height=&quot;27&quot; alt=&quot;Back&quot; name=&quot;Back&quot; border=&quot;0&quot;></a>
<a href=&quot;&quot; class=&quot;barbutton2&quot; onmouseover=&quot;MouseOver('CheckAll')&quot; onmouseout=&quot;MouseOut('CheckAll')&quot; onmousedown=&quot;checkall()&quot;><img src=&quot;checkallb.jpg&quot; width=&quot;122&quot; height=&quot;27&quot; alt=&quot;Check all&quot; name=&quot;CheckAll&quot; border=&quot;0&quot;></a>
<a href=&quot;&quot; class=&quot;barbutton3&quot; onmouseover=&quot;MouseOver('UnCheckAll')&quot; onmouseout=&quot;MouseOut('UnCheckAll')&quot; onmousedown=&quot;uncheckall()&quot;><img src=&quot;uncheckallb.jpg&quot; width=&quot;122&quot; height=&quot;27&quot; alt=&quot;Uncheck all&quot; name=&quot;UnCheckAll&quot; border=&quot;0&quot;></a>
<a href=&quot;&quot; class=&quot;barbutton4&quot; onmouseover=&quot;MouseOver('Install')&quot; onmouseout=&quot;MouseOut('Install')&quot; onmousedown=&quot;productSelected()&quot;><img src=&quot;installb.jpg&quot; width=&quot;122&quot; height=&quot;27&quot; alt=&quot;Install selected products&quot; name=&quot;Install&quot; border=&quot;0&quot;></a>
</BODY>
</HTML>
 
the reason for the error is because the line

<a href=&quot;&quot; class=&quot;barbutton1&quot; onmouseover=&quot;MouseOver('Back')&quot; onmouseout=&quot;MouseOut('Back')&quot; onmousedown=&quot;saveForm(); saveCookie('Products'); location='index.html'&quot;><img src=&quot;backb.jpg&quot; width=&quot;122&quot; height=&quot;27&quot; alt=&quot;Back&quot; name=&quot;Back&quot; border=&quot;0&quot;></a>

contains two function calls. Works fine in javascript!
I've replaced that with a call to a single function which then calls x number of functions.
 
Normall when you get an error like that it means you have a problem with your quotes&quot;&quot;.

I changed the line shown below

<a href=&quot; class=&quot;&quot;barbutton1&quot;&quot; onmouseover=&quot;&quot;MouseOver('Back')&quot;&quot; onmouseout=&quot;&quot;MouseOut('Back')&quot;&quot; onmousedown=&quot;&quot;saveForm(); saveCookie('Products'); location='index.html'&quot;&quot;><img src=&quot;backb.jpg&quot; width=&quot;122&quot; height=&quot;27&quot; alt=&quot;Back&quot; name=&quot;Back&quot; border=&quot;0&quot;></a>

Placing extra quotes as shown and no error, I am not saying gthis is a fix but it appears to be a quotes problem.

Hope this helps, no doubt somebody will give you the exact reason shortly.

Regards
Steve Friday
 
See they posted the fix before I could finish typing Regards
Steve Friday
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top