'ajax 작성'에 해당되는 글 1건

  1. 2016.05.25 ajax 사용 예제

ajax 사용 예제

웹/jquery 2016. 5. 25. 17:52

function qty_change(val)

{

$.ajax({

        type:"GET",//전송방식

        url:"/royal/main/qty_check?id="+val,//전송될 페이지

        dataType : "json",//리턴 받을 타입

        success: function(data){

//결과 값 = {"result_code" : 200 , "result_type" : "성공" .........}

if (data.msg == "정상")

{

document.all.f_t_qty.value=data.c_qty;

document.all.wr_id.value=data.wr_id;

//alert(document.all.f_t_qty.value);

}

else if(data.msg == "실패")

{

document.all.t_qty.value="";   

}

        },

        error: function(xhr, status, error) {

            alert(error);

        }   

    });

}

Posted by 몽키 D.루피
,