I am trying to display text in javascript tooltip
I keep getting inexhaustible string literals, though: a) quotes are shortened, b) there are no line breaks
The text I'm trying to display is as follows:
"No, we can't. This is going to be terrible."
(his quote is from a person, and I want these quotes to appear in the tooltip)
My hint function works as follows
onMouseOver="Tip('string here')"
After running a line through my cleanup function for javascript
function jschars($str) { echo preg_replace("/\r?\n/", "\\n", addslashes($str)); }
In HTML it looks like this:
onMouseOver="Tip('\"No, we can\'t. This is going to be terrible.\"')"
This gives me an error message with an inexhaustible string for the first \ in Tip ('\
I guess, because I'm trying to put quotes directly in single quotes, how can I get around this for situations like this? (I tried htmlspecial chars, for example, replacing "with" and "quot;", I still get the error message