ajax 赋值

 

  function  getCustomer(url, param, width, height) {
  
var rs = window.showModalDialog(url,param,"dialogWidth=" + width + "px;dialogHeight=" + height + "px");
  
var aValues=rs.split(",");
  $(
"#supplier").val(aValues[0]);
  getCustomerInfo($(
"#supplier").val());
 $(
"#suppliername").val(aValues[1]);
 }


 
 
    
function  getCustomerInfo(id) {
        alert(id);
       $.ajax(
{
          type: 'get',
         url: 
"<c:url value='/k4_oldGoldStorsge/getCustomer/'/>"+id,
         dataType: 'json',
         success: 
function(data) {
             alert(data.name);
             $(
"#receiveName").val(data.legalperson);   //name
             $("#receiverId").val(data.account);        //code
             $("#receiverBank").val(data.baseBank);     //account
             $("#receiverPhone").val(data.taxpayerTel);  //telephone
             $("#").val(data.);                        
         }

       }
);
 }

 

 

你可能感兴趣的:(ajax 赋值)