/* * 屏蔽特殊字符 */var charactererror = false;specialCharacterCheck = function (str) { var character = str; var characterTest = new RegExp("[`~!@#$%^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]") ; if(!(characterTest.test(character))){ charactererror = true;// $("#characterError").show();// $("#characterError").html("对不起,请不要填写特殊字符!"); }else{// $("#characterError").hide(); charactererror = false; } }