#11495 closed bug (invalid)
.load() always calls the success handler
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | ajax | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The success handler function always get called, even if the server returns 404 Not Found or 500 Internal Server Error.
Change History (3)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Component: | unfiled → ajax |
---|---|
Priority: | undecided → low |
Resolution: | → invalid |
Status: | new → closed |
@fastfasterfastest is right. You can check against the textStatus argument to see if the load was successful.
Example: http://jsfiddle.net/mofle/c5pYV/1/
comment:3 Changed 11 years ago by
You are right, I am wrong. Sorry for wasting your time, I should have payed more attention to the documentation.
Note: See
TracTickets for help on using
tickets.
The "success handler" is not a success handler, it is a complete callback - a function that gets called when the request has completed. See http://api.jquery.com/load/ and the 2nd example.