Possible Javascript "replace" function bug in Google Chrome -


open chrome browser, try this:

'x </script>'.replace(/x/,'\'$\'')  ---> "' </script> </script>" 

and one:

'x'.replace(/x/,'$$') --> "$" 

in ie, correct.

did wrong?

thanks nicholas's answer. function can used replacement parameter avoid issue.


Comments

Popular posts from this blog

php - Embed BBCode within itself not working -

three.js - how to load gltf in three JS -

sql server - T-SQL: Access DB objects in same schema without qualifying? -