Replace All in Javascript

str = str.replace(”find”,”replace”);

To ReplaceAll you have to do it a little differently. To replace all occurrences in the string, use the g modifier like this:

str = str.replace(/find/g,”replace”);

To replace "//" in to "/" use the escape character

strCode.replace(/\/\//g,"/");