I'm trying to add HTML to a page via AJAX. I have the HTML saved in a database, but when I retrieve it from the database and try to append on HTML with JQuery it always breaks the sting whenever the HTML contains a single quotation mark.
It worked when I used HTML special chars (Except obviously wasn't html), however when I tried to convert it back into HTML I got the same issue.
I need to do this to convert the PHP to Javascript, and used a single quote as the HTML uses double quotes for it's tags.
var val = '<?php echo $val ?>'
So any single quote in the HTML is going to break the string. I've tried a few things and tried to search for an answer and ended up giving up for a week :/