Web/javascript / jQuery

ajax post 방식에서 function 이 필요할때 두가지 방법

RAY.D 2015. 4. 28. 09:42




ajax post 방식에서 function 이 필요할때 두가지 방법 



방법 1.


        $.post("@Url.Action("", "")"

    , 파라미터

, function () {

//동작할 내용 넣음 });



방법 2.


$.ajax({             url: "@Url.Action("""")",             type: "POST",             dataType: 'json',             data: datavalue,             contentType: "application/json; charset=utf-8",             success: function (result) { //여기에 동작할 내용 넣음             }         });