首页 > Web开发 > 详细

jQuery判断是否为空

时间:2015-10-14 12:51:24      阅读:120      评论:0      收藏:0      [点我收藏+]
(function($){     $.isBlank = function(obj){         return(!obj || $.trim(obj) === "");     };  })(jQuery); $.isBlank(" ") //true  $.isBlank("") //true  $.isBlank("\n") //true $.isBlank("a") //false  $.isBlank(null) //true  $.isBlank(undefined) //true $.isBlank(false) //true $.isBlank([]) //true

jQuery判断是否为空

原文:http://my.oschina.net/u/1582930/blog/516909

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!