I'm trying to get some json data via .ajax() method in jQuery, here is my code:
$.ajax({
url: "http://localhost:8080/abc/message.js",
type: 'GET',
data: {},
beforeSend: function(x) {
if(x && x.overrideMimeType) {
x.overrideMimeType("application/j-son;charset=UTF-8");
}
},
datatype: 'json',
success: ajaxSuccess,
error: ajaxError
});
function ajaxSuccess(data,status){
alert(status);
if(data.updatetime > localtime)
{...}
}
"message.js" contains the json data I need. It do called the success function I defined (that is ajaxSuccess), but the data it parsed is an empty string("")... I've read the document provided by jQuery, and googled for similar problems ,but still can't figure out what's wrong.