2012-07-23 82 views
1

我正在向Twitter發送一個簡單的Ajax請求。從未調用JQuery Ajax錯誤函數

$.ajax({ 
      type: "GET", 
      url: "https://api.twitter.com/1/users/show.json?screen_name=twitterAPI&include_entities=true", 
      dataType: "jsonp", 
      success: function(data, textStatus, jqXHR){ 
       console.log("success"); 
      }, 
      error : function(XMLHttpRequest, textStatus, errorThrown){ 
       console.log("error"); 
      } 
    }); 

當我screen_name存在,成功函數被調用。但是,當screen_name不存在時,我的控制檯上出現Javascript錯誤,但錯誤功能從未被調用過。

錯誤在哪裏?

+0

*什麼錯誤信息*你好嗎? – Lion 2012-07-23 19:29:40

+0

404(Not Found) – kschaeffler 2012-07-23 19:31:15

+0

爲什麼屏幕名稱有時是空的 – zod 2012-07-23 19:34:55

回答