C
christopher.tokar
Hello,
I was wondering if there are any proper, robust libraries or
functions/methods that I don't know of that will escape all the
problematic characters such as single quotes and tabs. I find myself
writing
x = x.replace(/'/g,"\\'"); and the reverse over and over again.
Shouldn't Javascript have a built in method to do this? I know of the
escape() function but I am not sure if this is more for urls. What is
the real world way of storing such an "escaped" variable in a database
that will later be read into a javascript variable? :-/
Maybe one could use escape() and unescape() in some way, but some
expert probably could answer this in a snap.
Thanks!
Chris
I was wondering if there are any proper, robust libraries or
functions/methods that I don't know of that will escape all the
problematic characters such as single quotes and tabs. I find myself
writing
x = x.replace(/'/g,"\\'"); and the reverse over and over again.
Shouldn't Javascript have a built in method to do this? I know of the
escape() function but I am not sure if this is more for urls. What is
the real world way of storing such an "escaped" variable in a database
that will later be read into a javascript variable? :-/
Maybe one could use escape() and unescape() in some way, but some
expert probably could answer this in a snap.
Thanks!
Chris