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

Thread: missing ) after argument list ajax.updater

  1. #1
    Join Date
    Dec 2010
    Location
    California
    Posts
    20
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default missing ) after argument list ajax.updater

    This code is contained in an include. Maybe I've been looking too long, but the parenthesis is there. I'll appreciate any advice you have. Thanks!

    Code:
    <?php
    	$paintingBack=$paintingNumber-1;
    	$paintingNext=$paintingNumber+1;
    	if ($paintingBack < 1) {
    	$paintingBack = $paintingBack + 1;
    	}
    	?>
    		<a href="#" class='link' onFocus='if(this.blur)this.blur()' onclick="change_content('imagediv', '<img src='images/painting_<? echo $paintingBack; ?>.jpg'/>')"><img src='images/braceL.gif' alt='brace' width='20' height='11' valign='text-bottom'/></a>

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

    Default

    The SRC for your img tag uses single quotes, and this is within the string argument for the change_content() function.

    You must escape these quotes using \' instead of just '.
    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. The Following User Says Thank You to djr33 For This Useful Post:

    ksquared3 (02-04-2011)

  4. #3
    Join Date
    Dec 2010
    Location
    California
    Posts
    20
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks, djr33. I have tried that. Didn't work. Neither did many different combinations of delimiters and breaks. I may have to give up. My client is getting antsy. Of course, he doesn't care if the site has 56 pages instead of 6, but I do. Must.try.to.go.with.the.flow.

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

    Default

    There's no question that you must escape a symbol when it also denotes the end of a string (in a context like that). There may be other problems, but if you don't fix that, the code will never work and it should never work.
    Once it's fixed, you can start trying to debug things again and you may even get a more meaningful error notice.
    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

  6. #5
    Join Date
    Dec 2010
    Location
    California
    Posts
    20
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    OK then. I'll escape all ' within the string. Thanks.

  7. #6
    Join Date
    Dec 2010
    Location
    California
    Posts
    20
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    OK, done. The computed code =

    Code:
    <a href="" class='link' onFocus='if(this.blur)this.blur()' onclick="change_content('imagediv', '<img src=\'images/painting_2.jpg\'/>')"><img src='images/braceL.gif' alt='brace' width='20' height='11' valign='text-bottom'/></a>
    error: File not found. !

  8. #7
    Join Date
    Dec 2010
    Location
    California
    Posts
    20
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    fyi: This is the line of code in prototype.js that doesn't like the string. lines #1530-31

    Code:
    this.body = this.method == 'post' ? (this.options.postBody || params) : null;
    1531 this.transport.send(this.body);

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

    Default

    What file isn't found? I don't think the code you're using is causing that. Does this function work in other cases? Can you show us a working example?
    I think this may be beyond my knowledge of Javascript, but someone else can probably help. The escaping is correct, so that's at least the first step done.
    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

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

    Default

    What file isn't found? I don't think the code you're using is causing that. Does this function work in other cases? Can you show us a working example?
    I think this may be beyond my knowledge of Javascript, but someone else can probably help. The escaping is correct, so that's at least the first step done.
    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

  11. #10
    Join Date
    Dec 2010
    Location
    California
    Posts
    20
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Sorry, it's taken me so long to get back to you. I was up for days, finally got it working without using this function. No matter what I did, the escape character, \ , was never recognized and I had to move on. Thanks very much for your help.

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
  •