regexp:
var s = document.getElementById(“username”).value; if s == “\ \ \ \”; var result = s.replace(/\/g,””) will be wrong? why that firebug error ?
hope to the result is equals == “”, but firebug is output:
SyntaxError { source=”with(_FirebugCommandLine){(“\ \”).replace(/(\)/g,””);\n};”, message=”unterminated string literal”, fileName=”resource://firebug_rjs/console/commandLineExposed.js”, more…}
why that? please help me?
\ \ is a special character. See Special Characters in Javascript.
You have to escape
\.Should work.
BTW, what are you trying to do in your regEx match?