jQuery.ajax callbacks are not firing
I have an ASP.Net JSONP web service that I just created in hopes of taking advantage of the JSONP workaround for the XSS security "fix." It took me a while to finally get the AJAX call and web service to work together to return a HTTP 200 status, but that victory was bitter-sweet. Now, everything
appears to be working fine, but I am not getting any data or errors to help me move forward with this project. Can anyone help me? Here is an example of my JSONP code:
-
jQuery.ajax( {
type: 'GET',
contentType: 'application/json; charset=utf-8',
url: 'http://www.domain.com/JSON/JSONP-EndPoint.asmx/MethodName?callback=?',
data: { 'name' : JSON.stringify(ProductId) },
dataType: 'jsonp',
async: true,
success: function (data, textStatus){
alert('successCallBack called');
jQuery('#score').html(data);
jQuery('#score').hide();
score = data;
alert(textStatus);
},
error: function (XMLHttpRequest, textStatus, errorThrown){
alert('errorCallBack called');
alert('textStatus = ' + textStatus + '/nerrorThrown = ' + errorThrown);
} } );
The web service is supposed to return a single value of integer. However, I have no idea what it is or is not returning. I am not getting any error messages, my alerts are not firing, and the value is not assigned in the callbacks.
I have verified most of the process using HttpFox. However, due to a bug in the plugin, I do not know what the return content is or is not.
Can anyone offer any advice on how to troubleshoot this further? I will not post the web service publicly, but I can privately.
Note: For additional background information, I
created the JSONP web service using this tutorial as a guide.