For example, when a server sends a response with an undefined status code and status message, what is the specific behavior of the browser?
Reply to discussion (solution)
You can try it, it's not hard to write a statement.
Browsers generally can be fault-tolerant, anyway, I never tried to do that.
You can write a try ....
You can try it, it's not hard to write a statement.
Browsers generally can be fault-tolerant, anyway, I never tried to do that.
You can write a try ....
I tried, and I didn't find anything wrong. The files returned are not the same color except when viewed in the Network tab of Chrome's censorship elements.
But now, no problem, doesn't mean it's always going to be a problem? What I want to know is whether there will be any problems in the future.
Easy to enter, this is the principle of writing code, output to fault tolerance, but the output must conform to specifications
Easy into the hard out, this is the principle of writing code, output to fault tolerance, but the output must conform to the specifications of the extension server response file of the header what is the standard? I want to send some text to the browser, but the text does not exist in the body of the response file, but only in the header. But I don't know if Ajax can get all the head.
Check rfc2616 HTTP 1.1 standard
Check rfc2616 HTTP 1.1 standard is there any kind of response Header fields whose name is definitely not used by the standard? I have just used a name of more than 20 characters, but I still feel not at ease. Just checked, Ajax has this method: getResponseHeader (header), extracting the header is quite convenient.
Why not use cookies? The cookie is written in the header, not in the text
Why not use cookies? The cookie is written in the header, not in the text
4.7.3 the getResponseHeader () method
Client. getResponseHeader (header)
Returns the header field value from the response of which the field name matches header, unless the field name is Set-cook IE or set-cookie2.
http://www.w3.org/TR/XMLHttpRequest/#the-getresponseheader ()-method
After the server is passed to the browser and use JS to read the cookie, it feels a bit troublesome. And I do this thing there may be a lot of Ajax requests asynchronous execution, do not know whether the use of cookies will be messed up.