读书人

JQuery属性判断 + JSON 循环带参交付

发布时间: 2012-09-08 10:48:07 作者: rapoo

JQuery属性判断 + JSON 循环带参提交

//普通属性判断if($('#btn_customer').attr('title').replace(/(^\s*)|(\s*$)/g, "") == "2"){ //返回true}else{ //false}//checkbox  if($("#appo").is(":checked")){     //选中true   }esle{     //false   }//$.post提交var param = {};$('#currTable').find('input,select').each(function(){   param[this.name] = this.value;});param['ative'] = 'customer';$.post(url,param,function(data){if(data.result == 1){  alert('OK');}if(data == null){  alert('NO!');}},'json');

读书人网 >JavaScript

热点推荐