Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Conveyor Belt Slideshow - Error "Expected';'"

  1. #1
    Join Date
    Jan 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry Conveyor Belt Slideshow - Error "Expected';'"

    I realize that this may be a bit out of the scope of the forums but I'm giving this a shot since I'm at wits end with this.I am 98% complete in creating a "billboard" site using the (modified) Conveyor Belt Slideshow

    The test page w/ modified slideshow script.

    • Supporting JS and
    CSS files.

    The entire site (1.5Mb ZIP)

    The affected sections:
    - An iFrame (center right) for previewing slideshow photos
    - A layer (lower right) for info text

    The functionality is this:
    - Slideshow starts static
    - Clicking Play button starts slide show
    - Mouseover slows slideshow
    - Clicking picture should do three things (similar to what the links at the bottom of the page do);
    • stop slideshow (works)
    • display larger photo in iFrame id=preview (works)
    • display info text in frame using "swaplayers()" in JS file (broke)

    The problem line (#90) is this:
    leftrightslide[0]='<a href="film01.html" target="preview" onClick="stopslide();swapLayers(lyr5);return true"><img src="Film/01.jpg" border=0>'
    (Only this line has the layer swapping function for now)

    The fault occurs when I write - swapLayers('lyr5') - I get these errors:
    1)Line:90
    Char:92
    Code:0
    Error:Expected ';'
    2)Line:24
    Char:1
    Code:0
    Error:Object expected
    3)The slideshow photos do not load

    I suspect the fault is in the body onload events but can't seem to to track it although I continue to try. Any hints would be great! I'd really hate to have to overhaul this to make it work, but if I must.... Thanks in advance folks.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    No, this isn't out of our scope at all.
    Code:
    a.featureLinks:visited:hover {
    	font-size: 12px;
    	color: ##005500;
    	text-decoration: none;
    }
    First of all, watch where you're putting those hashes. You could have someone's eye out.
    Secondly, see:
    Code:
    function stopslide(){
      copyspeed=0
      clearInterval(lefttime)
    }
    This obviously causes an error if the slideshow hasn't started yet, as lefttime doesn't exist. Add simple error checking:
    Code:
    function stopslide(){
      if(!lefttime) return;
      copyspeed=0
      clearInterval(lefttime)
    }
    Thirdly, one problem in your first example is that you're passing it a non-existent variable where it expects a string. If that actually is a valid object, it shouldn't be. Pass it the ID of the element, as a string, surrounded in quotes. Could you do this on your demo page?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jan 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thirdly, one problem in your first example is that you're passing it a non-existent variable where it expects a string. If that actually is a valid object, it shouldn't be. Pass it the ID of the element, as a string, surrounded in quotes.
    Thanks Twey, are you referring to the "swapLayers(lyr5)" argument? "lyr5" is the id of the layer. But when I wrap it with "" or '' I get the errors previously stated. The site is now posted with the ' ' quotes. Perhaps I'm not understanding your request... other changes made & posted.

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You need to escape those single quotes, as the whole tag is already wrapped in single quotes.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Jan 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I've tried several ways to escape the quotes previously:
    \'lyr5\'

    Then by inserting a string delimiter in the string literal:
    '\'lyr5\''
    '"lyr5"'
    "\"lyr5\""

    and on and on... nothing seems to work, still get the errors. That's why I think there's an onload conflict.

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    No, an onload conflict would result in a very different set of symptoms.
    Code:
    leftrightslide[0]='<a href="film01.html" target="preview" onClick="stopslide();swapLayers(\'lyr5\');return false;"><img src="Film/01.jpg" border=0></a>';
    That should work nicely.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Jan 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    OK, I just tried this...
    /'/lyr5/'/
    "/'/lyr5/'/"

    And now get... getting closer
    Line:90
    Char:1
    Code:0
    Error:'lyr5' is undefined

  8. #8
    Join Date
    Jan 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I've tried (\'lyr5\') previously ... the errors go away, but the layer does not display.

  9. #9
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    OK, I just tried this...
    /'/lyr5/'/
    "/'/lyr5/'/"
    The last one won't work because no such element exists You can't escape with forward slashes.
    Apply my code on your demo page and let me see.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  10. #10
    Join Date
    Jan 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Code applied & posted. I had tried the the one semi-colon but not at the end of the line. No errors but also no layer.

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
  •