//id是标签的id
function regeMatch(id){
var pattern = new RegExp("[▪•‥△▽○◇□☆▷◁♤♡♢♧▲▼●◆■★▶◀♠♥♦♣☼♀☺◐☑✔☜☝☞㏂☀☾♂☹◑☒×✘☚☟㏘…▁▂▃▄▅▆▇█" +
"∷※░▒▓▏▎▍▌▋▊▉♩♭☌♈♪♫♬§〼◎۞℗®♯♮‖¶卍卐▬℡™㏇☍☋☊㉿◪◪◔◕@㈱№♉♊♋♌♏♐♑♓♒♍↖↑↗▨▤▧◤㊤◥" +
"☴☲☷←㊣→▩▦▥㊧㊥㊨☳☯☱↙↓↘▫◈▣◣㊦◢☶☵☰↕↔⊱⋛⋌⋚⊰¬¬▔†‡**✲❈✿✿❀❃❁☸✖✚✪❤ღ❦❧ி₪✎✍✌✁✄☏" +
"✉⊹➷☡☈☇♨☄☃☂☁☎ஐ☩➹〄☮☪❂☭☠☣✈〠۩✙✟☥☦☧☨☫☬♔♚♛♗♝♘♞♖♜♙♟]");
if($("#"+id).val() != "" && $("#"+id).val() != null){
if(pattern.test($("#"+id).val())){
return "输入的文字中含有非法符号";
}else{
return true;
}
}
}
前端——》JS检测非法字符
猜你喜欢
转载自blog.csdn.net/nienianzhi1744/article/details/88026488
今日推荐
周排行