tags:

views:

77

answers:

2

Been looking at this for a while and even posted another question and got half the answer but the error still persists expected ';' character 392

+12  A: 

It is extremely bad style to put that much code into an inline onclick event exactly for this reason: It becomes a bitch to debug. I would recommend creating a function - named "lpButtonClick" or something - in a separate .js file, or a <script> block in the document's head.

I'm sure that when you do that, and separate each command into one line, the reason for that ; error will come to light quickly.

Your link's onclick event would then look like this:

onClick="return lpButtonClick();"

alternatively, iyou could avoid setting the event in the markup altogether. If you work with jQuery, giving the link an ID would look like this - put it into the ready event:

$("#linkID").click(function() { return lpButtonClick(); });
Pekka
I would also add, to even further simplify things, you could make your HREF and SRC values php variables. This would make debugging HTML/JS problems even easier by making your code more readable.
Joe D
+1  A: 

Please, follow Pekka's advice!

But, you error lies in that you're missing a '; to end one of your strings.

In your code, you have:

escape(document.location) +' imageUrl={URL} lpButtonCTTUrl = ...

But, I think you want to close that string and start a new statement. You'd have to add '; to the end of that imageUrl string like this:

escape(document.location) +' imageUrl={URL}'; lpButtonCTTUrl = ...
palswim