Javascript – Replacing the escape character in a string literal
If it’s a literal, you need to escape the backslashes before Javascript sees them; there’s no way around that. var newpath=”file:///C:\\funstuff\\buildtools\\viewer.html”; window.location = newpath; If newpath is getting its value from somewhere else, and really does contain single backslashes, you don’t need to double them up; but if you really wanted to for some reason, … Read more