Quotation & Single Quotes throw off my Javascript...

3 posts by 2 authors in: Forums > CMS Builder
Last Post: May 19, 2010   (RSS)

Re: [hordak] Quotation & Single Quotes throw off my Javascript...

By Chris - May 13, 2010

Hi hordak,

To escape quotes so you don't break your javascript, you can use addslashes():

'<?php echo $upload['filename'] ?>': { caption: '<div class="subhead_gold"><a href="<?php echo $record['link'] ?>"><?php echo addslashes($upload['info1']) ?></a></div><?php echo addslashes($upload['info2']) ?>' },
<?php else: ?>
'<?php echo $upload['filename'] ?>': { caption: '<div class="subhead_gold"><a href="<?php echo $record['link'] ?>"><?php echo addslashes($upload['info1']) ?></a></div><?php echo addslashes($upload['info2']) ?>' },


I hope this helps. Please let me know if you have any questions.
All the best,
Chris

Re: [chris] Quotation & Single Quotes throw off my Javascript...

By hordak - May 19, 2010

Thanks Chris; that did it!

problem solved...