const patern =/[`~!@#$%^&*()_+<>?:"{},.\/;'[\]]/im;
if (patern.test(articleName)) {
alert("含有非法字符!");
return
}
本文标题:检测js是否有非法字符
本文链接:https://www.haomeiwen.com/subject/erfraqtx.html
网友评论