Quantcast
Channel: w3cplus
Viewing all articles
Browse latest Browse all 1557

检查一个存在的、非空的字符串

$
0
0
//如果变量存在,是一个字符串,并且其长度大于0,结果为真
if(((typeof unkownVariable != "undefined") && (typeof unkownVariable.valueOf() == "string")) && (unkownVariable.length > 0)){

}

Viewing all articles
Browse latest Browse all 1557

Trending Articles