How to catch error in jQuery's load() method
问题 I'm using jQuery's .load() method to retrieve some data when a user clicks on a button. After the load successfully finishes, I show the result in a <div> . The problem is, sometimes an error occurs in load() while retrieving the data. How can I catch an error in load() ? 回答1: load() documentation. Just a little background on how a load error happens... $("body").load("/someotherpath/feedsx.pxhp", {limit: 25}, function (responseText, textStatus, req) { if (textStatus == "error") { return "oh