0

Crossdomain Ajax call issue on ios device. I am getting alerts of error function only on ios devices but it is working fine on android.

Sample Code:

$.ajax({
        type: 'GET',                                    
        url: 'http://differentdomainurl',           
        jsonpCallback: 'jsoncallback',                      
        contentType: "application/json",                
        dataType: 'jsonp',                              
        cache: false,                                   
        timeout: 10000,
        success: function(data)
        {
          alert(JSON.stringify(data));
        }
        error: function(jqxhr, txtstatus, errormsg)
        {
          alert(JSON.stringify(jqxhr));
          alert(errormsg);
        }

Above code gives me 2 alerts - 1) "readyState":4, "status":200, "statusText":"success" 2) Error: jsoncallback was not called

Can anybody help?

  • Possible duplicate: http://stackoverflow.com/questions/15477527/cross-domain-ajax-request – Lohardt Dec 04 '13 at 08:59
  • does the ajax url contains a `"?"` – Jai Dec 04 '13 at 09:02
  • @ Lohardt - No friend. The question is different than the question you are referring. I am getting response in android device but not in ios device. It is not calling my callback function – Mukund Deshmukh Dec 04 '13 at 10:27

0 Answers0