`
kenrome
  • 浏览: 39880 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

为空判断

阅读更多
服务器端的为空判断:ruby

class String
	def blank?
		self.nil? || self.strip.empty?
	end
end


网页前端的为空判断:js
function Check()
	{
		sel = document.yform.manual_action_title_select.value.replace(/\s/gi,"");
		input = document.yform.manual_action_title_input.value.replace(/\s/gi,"");
		if( sel == "" && input == "" ) {alert("value required!");return false;}
		
		return true;
	}

0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics