Jquery对特殊字符的过滤

var pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?%]");
                    var result = token.match(pattern);
                    if(result){
                        layer.msg("含有非法参数", {icon: 5});
                        return;
                    }

猜你喜欢

转载自blog.csdn.net/waterdemo/article/details/88949516