$.getJSON – ajax is sent but callback function is ignored – Internet Explorer-Collection of common programming errors
As it fails in specific browsers, it’s likely that it is a combination of unexpected headers in the response, and how the browser handles the data based on that.
If for example the response has the content type text/html
instead of application/json
, the browser might try to turn the response content into a HTML document (by adding pre
tags around it), which would then cause the JSON parsing to fail.
If you use the $.ajax
method, you can also catch any error message, which would give you a clue to what’s going on:
$.ajax({
url: addr,
dataType: 'json',
success: function(data){
alert('whoooo working'); //