Tuesday, May 7, 2013

jQuery ajax call tip


In a jQuery  ajax call,
note that the dataType should be only "json" and
NOT "application/json".

When the dataType was given as "application/json"
it did not work.


A basic minimum ajax call may look like :


            $.ajax({
                type: "POST",
                dataType: "json",
                url: "Service.svc/DoWork",
                success: function(result) { alert(result.d); }
            });

No comments:

Post a Comment