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

How to check local and global angular versions

 Use the command ng version (or ng v ) to find the version of Angular CLI in the current folder. Run it outside of the Angular project, to f...