Escaping and UnEscaping Strings?

The following command returns the raw source of an email, as a string:

	set myselection to selection
	source of item 1 of myselection as string
end tell

In the result box, that string is properly escaped. Quotes have \ before them, it looks ready to be used.

HOWEVER when I try to use that string in safari to submit it into a form field (specifically a textarea), the escaping disappears and I get javascript errors.

tell application "Safari"
	set JSCommand to "document.getElementsByName('spam')[0].value = '" & MailSource & "';"
		do JavaScript JSCommand in document 1
end tell

What gets sent to Safari is no longer escaped, and I end up getting javascript errors because the first apostrophe prematurely ends the string and the rest of the string immediately throws an error, as you would expect.

WHO exactly is un-escaping the string? How can I prevent that?

From another post, about a different person have a different problem, but relevant here:

“If a text object contains a \ then the script editor will add a leading backslash when it displays the result, but that doesn’t mean it’s there - it’s only added for display purposes.”

Suggesting that my string isn’t REALLY escaped, it just looks it in the Script Editor result box. So then the question now goes back to the simple question of, how do you quote a string in applescript to be used as a string in javascript via do javascript ?