Posted on 2012-03-14
I am trying to "push" values into an array after they've been used in an eval() statement. The issue I'm running into is that with the way I'm concatenating the string, the double quotes inside the "text being evalled" is causing the eval() function to choke.
Here is an example.
Description fields is equal to --------> This is a test, "yes", a test
eval("obj." + "description" + " = '" + $('#description').val() + "'");
With this as an example, the " in "yes" messes things up. I've tried using " but the & then messes it up. I've also tried replacing the " with \".
Any suggestions on how to "escape" the double quote?