日期:2014-05-16  浏览次数:20641 次

jquery.getJSON() 报错
使用jquery1.7,在html文件中调用jQueryReadJsonFile()方法,js关键代码如下:

var global_jsonData = null;
var global_jsonFile = "navigation.json";
function jQueryReadJsonFile() {
  $.ajaxSetup({ cache: false });
  global_jsonData = $.getJSON(global_jsonFile, function(jsonData) {
  alert(jsonData);
  })
  .success(function() {
  alert("success");
  })
  .error(function() {
  alert("error: " + global_jsonData.readState);
  })
  .complete(function() {
  alert("complete"); 
  });
}

页面访问弹出error: undefined

请问什么原因执行getJSON方法错误?

------解决方案--------------------
是readyState,不是readState