Tuesday 13 March 2012

Jquery ajax call to WCF stops working when upgrading to jquery 1.7.1

This had me puzzled for ages. When upgrading the version of jquery we use from 1.5 to 1.7.1 so that we could use Bootstrap popovers, any calls to our WCF .NET service would fail with a blank error message returned.


What I found was that within out Ajax call we had set:


jsonp: "callback", dataType: "json"

In 1.5 this worked fine, however in 1.7.1 it had noticed that the response type was supposed to be jsonp (JSON with padding) and thus bombing out with a mismatch.


Changing this to the correct format of:


jsonp: "callback", dataType: "jsonp" 

Fixed the problem.

No comments:

Post a Comment