Results 1 to 9 of 9

Thread: expected ';' error?

  1. #1
    Join Date
    Jul 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default expected ';' error?

    What does the error
    Line 136, Character 50, expected ';'
    mean?

    This is line 136:

    leftrightslide[0]='<a href="javascript:ajaxpage('links.htm', 'contentarea');"><img src="itemp/sp-airborne.gif" border=0

    Your help is appreciated!

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Well, looks to me like you're probably missing a semicolon at the end of the line.
    However, it seems more like an error with quotes...


    leftrightslide[0]='<a href="javascript:ajaxpage('links.htm', 'contentarea');"><img src="itemp/sp-airborne.gif" border=0...///finishline///....';
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Jul 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by djr33 View Post
    Well, looks to me like you're probably missing a semicolon at the end of the line.
    However, it seems more like an error with quotes...


    leftrightslide[0]='<a href="javascript:ajaxpage('links.htm', 'contentarea');"><img src="itemp/sp-airborne.gif" border=0...///finishline///....';
    Thanks for the reply! I tried putting a semicolon at the end of the line (no change) and then putting a semicolon at at various places. The error message changed when I eventually enclosed links.htm in semicolons. But then it said error, links.htm undefined.

    There's got to be a way to make leftrightslide[0]='<a href="javascript:ajaxpage('links.htm','contentarea');"> act like leftrightslide[0]='<a href="mypage.htm">

  4. #4
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    leftrightslide[0]='<a href="javascript:ajaxpage(/'links.htm/',/'contentarea'/);">'
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  5. #5
    Join Date
    Jul 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by tech_support View Post
    leftrightslide[0]='<a href="javascript:ajaxpage(/'links.htm/',/'contentarea'/);">'
    Thanks, too. Unfortunately, that generated the same error. I tried using (/'links.htm'/ too but that made no difference.

  6. #6
    Join Date
    Aug 2006
    Posts
    239
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    because that should be backslashes: \'

  7. #7
    Join Date
    Jul 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I got it to work with some help from madlemming at Tech Report:


    leftrightslide[0]='a href=\"javascript:ajaxpage(\'contact.htm\', \'contentarea\');\">';

    Thanks for everyone's help!

  8. #8
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    1. Each line must end with a semicolon.
    2. Quotes come in pairs, enclosing things.
    You cannot, for example, have:
    '<a href="image.jpg">;
    since you need to END the first single quote.
    3. Neither quotes nor semicolons are to be placed randomly... they each have a specific purpose. Placing them in the wrong spot or in the wrong way will create an error. By doing what you said, placing it in the middle of the line, you CAN suppress the error by giving it a semicolon, but that will just create more problems because that semicolon does NOT belong there.

    Basically.... semicolons only and always at the end of lines; quotes in pairs, always be sure they are.

    I think the confusion here is that you were using javascript to write html that included javascript commands, thereby giving yourself several layers of quotes to deal with.

    Glad it works.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  9. #9
    Join Date
    Jul 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the the rules. They will come in handy for future problems.

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
  •