Side navigation
#11495 closed bug (invalid)
Opened March 21, 2012 09:42AM UTC
Closed March 21, 2012 11:51PM UTC
Last modified March 22, 2012 11:52AM UTC
.load() always calls the success handler
Reported by: | eldmannen+jquery@gmail.com | 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.
Attachments (0)
Change History (3)
Changed March 21, 2012 07:29PM UTC by comment:1
Changed March 21, 2012 11:51PM UTC by comment:2
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/
Changed March 22, 2012 11:52AM UTC by comment:3
You are right, I am wrong.
Sorry for wasting your time, I should have payed more attention to the documentation.
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.