I\'m trying to replace the \"\'\" character with the \"\'\'\" string using the replace method, like this:
temp.replace(\"\\\'\", \"\'\'\");
but
The problem is that
temp.replace("\'", "''");
will only replace the first instance of '. To fix this, do the following instead
temp.replace(/'/g, "''"));
This will ensure it goes though and replaces all instances of the single quote instead of just the first.