What I am doing:
I am storing (MySQL) formatted text that is structured like this:
I'm Robert (I'm = I am)<br>You're in France (You're = You are)<br><br><strong></strong><span class="st">?</span> <b>I</b>'m Robert <br>? Am Robert <del> <br></del><br>? <b>You</b>'re Robert <br>? Are Robert <br><br>I'm = I am<br>You're = ___ ___?<br><br><br><br>
I am trying to retrieve this string from the database an then append it into a WYSIWYG editor like this.
function enableEditMode(){
card_content.document.designMode = 'On';
$('iframe[name=card_content]').contents().find('body').append("I'm Robert (I'm = I am)<br>You're in France (You're = You are)<br><br><strong></strong><span class="st">?</span> <b>I</b>'m Robert <br>? Am Robert <del> <br></del><br>? <b>You</b>'re Robert <br>? Are Robert <br><br>I'm = I am<br>You're = ___ ___?<br><br><br><br>");
}
I get the following error:
SyntaxError: missing ) after argument list
I assume this is because of the "" quotes causing issues.
Question:
How do I go about appending HTML into the DOM without encuring syntax errors like this?
"in the string with\"so that its escaped. Exactly how you do that will depend on the server language you're using to get data from your SQL database