Depending on what your code is trying to do, I'm not sure why you are specifying both jsonpCallback and success in your $.ajax call. I would suggest you specify success to process your data and process your paging. Let jQuery determine the name of your jsonp callback.
Essentially, what the jsonp callback does is it gets the payload from your WCF data service and then passes it to your success handler. It looks like you could use jsonpCallback if you want to do some caching or some other data preprocessing before processing your success handler. I'm not sure why in this case you should specify the same function as your jsonpCallback and success handlers. (I briefly looked at Stephenβs article that you contacted, and Iβm not because he does this.)
The following is an example of calling jsonp in a WCF data service, which I use in demos and conversations (and you use them for a while). I am using JSONPSupportBehaviorAttribute to enable JSONP in my WCF data service (not sure if this is what you are using or not).
But in my code example, I do not specify the name jsonpCallback ; I just specify the jsonp jsonp parameter (should be $callback instead of the standard callback ), but I give jQuery the name of the jsonp callback function.
My success handler is called once, and everything works fine. So I would like to forget about jsonpCallback , keep your success handler in place, and I think things should start working better.
Hope this helps. Let me know if you have further questions. Good luck
$.ajax({ url: 'http://server:25812/Services/AgileWays.Baseball.Service.svc/Teams?$format=json&$filter=yearID eq 1882', type: 'GET', dataType: 'jsonp', cache: false, jsonp: '$callback', error: function (x, t, r) { alert(x.response.message); }, success: function (data) { $.each(data.d.results, function (i, val) { $("#results").append("<div>" + val.name + "</div>"); }); } });