首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

替空判断

2012-10-31 
为空判断服务器端的为空判断:rubyclass Stringdef blank?self.nil? || self.strip.empty?endend网页前端的

为空判断
服务器端的为空判断:ruby

class Stringdef blank?self.nil? || self.strip.empty?endend


网页前端的为空判断: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;}

热点排行