I am trying to replace the backslash (escape) character in a Javascript string literal.
I need to replace it with a double backslash so that I can then do a redirect:
var newpath = 'file:///C:funstuffbuildtoolsviewer.html'.replace(/\/g,\);
window.location = newpath;
However, it seems to have no result.
I don't have the option of properly escaping the backslashes before they are handled by Javascript.
How can I replace () with (\) so that Javascript will be happy?
Thanks,
Derek