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!

missing ) after argument list - ajax.updater 1

Status
Not open for further replies.

ksquared3

Programmer
Sep 2, 2007
18
US
Wondering what I can do to fix this error:
missing ) after argument list
[Break On This Error] change_content('imagediv', '<img src='images/painting_2.jpg'>');

This code is contained in an include.

The parentheses are there. ??

On webpage the problem is the left bracket on menu "paintings".

Thank you.

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>
 
Looks like you are using single quotes inside single quotes. Try changing the inside pair to doubles
Code:
change_content('imagediv', '<img src=[COLOR=red]"[/color]images/painting_2.jpg[COLOR=red]"[/color]>');


If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Thanks, johnwm.

I believe it's this code that's having the problem:

'<img src='images/painting_<? echo $paintingBack; ?>.jpg'>');">
 
So change it in the PHP - still the same problem.

If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Using double quotes there will cause the same issues, because that line is already in double quotes. You'll need to escape your single quotes. Otherwise the arguments for your change_content function get screwed up.

Code:
onclick=[red]"[/red]change_content([COLOR=white blue]'[/color]imagediv[COLOR=white blue]'[/color], [COLOR=white blue]'[/color]<img src=[COLOR=white green]\'[/color]images/painting_<? echo $paintingBack; ?>.jpg[COLOR=white green]\'[/color]>[COLOR=white blue]'[/color]);[red]"[/red]>


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Thanks, vacunita. The slash after <img src= triggers the path to go back up toward the root directory. I tried escaping the slash (\\) but that didn't work. This is maddening.
 
That should work, at least it works for me correctly. You can;t escape the slash, because then it won't escape the quote.

The slash should not be affecting the path, as it is just escaping a quote, and its not part of the path. Slash before quote.

What exactly is happening?

You might be having issues with PHP since your PHP tags are the short type, which can cause problems with XML. I suggest you make them full tags. <?PHP ?>





----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Oh, OK I'll try that. Thanks! If this doesn't work, I'll show you what happens when I use the escape slash.
 
I'm sorry it did not work.

The url was read as : %3Cimg%20src=%27images/painting_2.jpg%27%3E

 
That looks about right:

It turns into:
<img src='images/painting_2.jpg'>

Is that not where your image is?

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Hold on. I'm now seeing an FireFox error:

missing ; before statement
[Break On This Error] if(this.blur)this.blur)

Maybe this is screwing things up. I'll see what I can do.

kk
 
The "missing ;..." error has been fixed. But, no matter what combination of delimiters and escape characters (I've been at this for hours) I use, even when the string is accepted and it is correct, and there is no error message, the new image is not displayed. Looks like this site is going to have to be 56 pages as opposed to 6. feh.
 
The code is now working more or less, solved this problem though. If anyone wants the code, just ask. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top