function checkKey(key) {
if($.trim(key) == ''){
/**
* 輸入的字符串為空,空格
*/
alert('請輸入關鍵字');
return false;
}else{
/**
* 輸入的字符串為
*/
return true;
}
}
$.trim(key) 相當於python3中的str.strip()
轉自:https://www.cnblogs.com/handsomeBoys/p/6767459.html