When using Ajax with PHP, which of the following are necessary to verify success?
Which of the following answers are correct ?
- HTTP ready state of TRUE
- HTTP ready state of 4
- HTTP status code <开发者_运维问答 400
- HTTP status of 200
- Data present in the response
both HTTP status of 200 and HTTP ready state of TRUE
In all my apps, I require only ready state 4
for success, which means as little as: the request is done and the response (if any) is available.
But like Madmartigan very wisely commented: define your version of success.
Usually, an HTTP ready state of 4 and HTTP status code of 200 is needed in order to guarantee that data has been successfully transferred back to your program.
精彩评论