The full error message is:

missing ) after argument list
[Break On This Error] change_content('imagediv', '<img src='images/painting_2.jpg'>');

Maybe I've been staring at this for too long, but I believe the parentheses are in the correct position. This code is contained in an include.

Thank you.

<?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>

Recommended Answers

All 5 Replies

You need to escape the single quotes in function call.

<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>

Hi, paulrajj, thank you!

Getting close. But, I think, because of the back slash after <img src= the upper level directories are listed:
The requested URL /meg/peek/<img src='images/painting_2.jpg'/> was not found on this server.

But without the forward slash there, the old missing ( pops up.

just replace your existing anchor part with my code. remove the backslash(/) from img tag. You need to use forward slashes to escape the quotes.

Oh, sorry, I was calling \ a backslash. I did use your code exactly and got the path problem.

Sorry it's taken me so long to get back here. I was up for days. I finally abandoned the change_content function. The escape character was never recognized.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.