Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
168
rated 0 times [  174] [ 6]  / answers: 1 / hits: 22054  / 13 Years ago, wed, august 3, 2011, 12:00:00

I am having a very weird error on this block:



<script type=text/javascript>
var captions = new Array();
captions[0] = ;
captions[1] = '<div class=cap-desc><h3>No Win - No Fee</h3><span class=captionSubhead>Performance Guarantee</span><br /><span style=color:#636363; font-size:13px;>Ask Today. We are very confident<br />you'll be impressed with our results! </span></div><br /><a href=http://# class=rmore target=_blank>read more</a>';
</script>


The error tells me that I am missing a ';' before captions[1] but I am pretty sure that captions[0] has a semi-colon!



The whole site is here: http://katron.sourcefit.com/cms02/a&a/



It has 5 captions now, but same error nonetheless. I tried changing the contents of the caption in question. In this case, it's captions[1] and it works. What is wrong with the caption? I am sure I am closing all tags and quotes and escaping n to


More From » javascript

 Answers
30

You are not escaping a single quote properly...



captions[1] = '<div class=cap-desc><h3>No Win - No Fee</h3><span class=captionSubhead>Performance Guarantee</span><br /><span style=color:#636363; font-size:13px;>Ask Today. We are very confident<br />you'll be impressed with our results! </span></div><br /><a href=http://# class=rmore target=_blank>read more</a>';


This just escapes the apostrophe in




you'll



[#90851] Monday, August 1, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jarrettw

Total Points: 300
Total Questions: 98
Total Answers: 103

Location: Saudi Arabia
Member since Mon, Sep 5, 2022
2 Years ago
;