js空串判断

来源:互联网 发布:unity3d塔防游戏 编辑:程序博客网 时间:2024/06/10 21:46
String.prototype.isBlank = function(){    var s = $.trim(this);    if(s == "undefined" || s == null || s == "" || s.length == 0){        return true;    }    return false;};

调用方式

if(!str.isBlank()){}
0 0
原创粉丝点击