jquery Ajax 조작 방법

2613 단어 jQuery ajax
    :http://jun1986.iteye.com/blog/1399242

//1.$.ajax json       
var aj = $.ajax( {  
    url:'productManager_reverseUpdate',//     action  
    data:{  
             selRollBack : selRollBack,  
             selOperatorsCode : selOperatorsCode,  
             PROVINCECODE : PROVINCECODE,  
             pass2 : pass2  
    },  
    type:'post',  
    cache:false,  
    dataType:'json',  
    success:function(data) {  
        if(data.msg =="true" ){  
            // view("    !");  
            alert("    !");  
            window.location.reload();  
        }else{  
            view(data.msg);  
        }  
     },  
     error : function() {  
          // view("  !");  
          alert("  !");  
     }  
});


//2.$.ajax                
function noTips(){  
    var formParam = $("#form1").serialize();//             
    $.ajax({  
        type:'post',      
        url:'Notice_noTipsNotice',  
        data:formParam,  
        cache:false,  
        dataType:'json',  
        success:function(data){  
        }  
    });  
}  


//3.$.ajax  url     
var yz=$.ajax({  
     type:'post',  
     url:'validatePwd2_checkPwd2?password2='+password2,  
     data:{},  
     cache:false,  
     dataType:'json',  
     success:function(data){  
          if( data.msg =="false" ) //     false,  validatePassword2    pwd2Error,    ,          
          {  
               textPassword2.html("<font color='red'>       !</font>");  
               $("#validatePassword2").val("pwd2Error");  
               checkPassword2 = false;  
               return;  
           }  
      },  
      error:function(){}  
}); 


//4.$.ajax  data     
$.ajax({   
    url:'<%=request.getContextPath()%>/kc/kc_checkMerNameUnique.action',   
    type:'post',   
    data:'merName='+values,   
    async : false, //   true      
    error:function(){   
       alert('error');   
    },   
    success:function(data){   
       $("#"+divs).html(data);   
    }
});
 

좋은 웹페이지 즐겨찾기