G
Gaspar
I really don't get when to use strings with single quotes, double
quotes, replace them by special html characters ("), etc.
Lots of problem arrise when my application outputs some html with a
string contaning single quotes, like "My name is Nick O'Haran", or even
some application-generated javascript code like "alert("This message
it's ok")". For example:
<input type="button" onclick="alert('My name is Nick O'Haran')">
or
<input type="button" onclick="someFunction();alert("This message it's ok")">
When do I have to replace single quotes by ' ?
When do I have to replace double quotes by " ?
When do I have to backslash double quotes (" --> \") ?
Do Firefox and IE6 handle strings the same way?
Thanks in advanced.
quotes, replace them by special html characters ("), etc.
Lots of problem arrise when my application outputs some html with a
string contaning single quotes, like "My name is Nick O'Haran", or even
some application-generated javascript code like "alert("This message
it's ok")". For example:
<input type="button" onclick="alert('My name is Nick O'Haran')">
or
<input type="button" onclick="someFunction();alert("This message it's ok")">
When do I have to replace single quotes by ' ?
When do I have to replace double quotes by " ?
When do I have to backslash double quotes (" --> \") ?
Do Firefox and IE6 handle strings the same way?
Thanks in advanced.