function ifErrChar( str ){
var re= /\'|<|>|&|\\/;
if(re.test(str)) return true;// yes, it contains special charactor
return false; // no ' & ...
}
var re= /\'|<|>|&|\\/;
if(re.test(str)) return true;// yes, it contains special charactor
return false; // no ' & ...
}
function isErrChar( str ){
return !/['"&<>]/.test(str)
}
alert(isErrChar("'"))
alert(isErrChar("\""))
alert(isErrChar("<"))
alert(isErrChar(">"))
alert(isErrChar("&"))
alert(isErrChar("a"))</script>