SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Chepstow, South Wales
    Posts
    910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    error '800a0401' Expected end of statement problem

    I am trying to add the following code into a functions page and I keep getting the following error.

    Code:
    Microsoft VBScript compilation 
    
     error '800a0401'
    Expected end of statement
    /includes/functions.asp, line 498wr "<a href='#' class='showImg active' onmouseup='" & return Swap(this,imgHolder); & "'><img class='HomeFeaturedImages3' src='/products/" & arr(0,i) & "/" & filename & ".jpg' width='75' alt='" & Server.HtmlEncode(arr(13+j,i)) & "' /></a>" & vbcrlf
    -------------------------------------------------------------^

    Here is my code:

    Code:
    function Swap(obj,id){
     var main=document.getElementById(id).getElementsByTagName('IMG')[0],msrc=main.src,obj=obj.getElementsByTagName('IMG')[0],tsrc=obj.src;
     main.src=tsrc;
     obj.src=msrc;
     return false;
    }
    
    wr "<a href='#' class='showImg active' onmouseup='" & return Swap(this,imgHolder); & "'><img class='HomeFeaturedImages3' src='/products/" & arr(0,i) & "/" & filename & ".jpg' width='75' alt='" & Server.HtmlEncode(arr(13+j,i)) & "' /></a>" & vbcrlf

  2. #2
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Chepstow, South Wales
    Posts
    910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry I think I have seen the error of my ways:

    Code:
    wr "<a href='#' class='showImg active' onmouseup='<script>return Swap(this,'imgHolder');</script><img class='HomeFeaturedImages3' src='/products/" & arr(0,i) & "/" & filename & ".jpg' width='75' alt='" & Server.HtmlEncode(arr(13+j,i)) & "' /></a>" & vbcrlf
    Why i say that is because the error has now gone, but the swapping of images doesnt work. Maybe best to take this now to jscript forum, but is the above correct in how it looks.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •