检测js是否有非法字符
2019-05-13 本文已影响0人
zhu733756
const patern =/[`~!@#$%^&*()_+<>?:"{},.\/;'[\]]/im;
if (patern.test(articleName)) {
alert("含有非法字符!");
return
}
const patern =/[`~!@#$%^&*()_+<>?:"{},.\/;'[\]]/im;
if (patern.test(articleName)) {
alert("含有非法字符!");
return
}