Re: [whatwg] HTTP status code from JavaScript

Hi Julian

Yes, with "AJAX" requests I meant using XMLHTTPRequest.

> If the initial page load yields a 404 will there be any scripts to
> execute at all?

Oh yes, absolutely. Have you ever written a single page app? There is
lots of logic to execute when a 404 occurs. I could count plenty of use
cases and functions that make sense. Here some examples:
- Notify the administrator about a 404 by email with a response back to
the server
- Display a beautiful 404 page and hide parts of the navigation
- Reveal navigation history to give users a better usability experience
during 404s
- And many more ...

All these above examples run on JavaScript. Because there is currently
no way for JavaScript to determine if the page load yielded a 404, a
subsequent request, namely a XMLHTTPRequest one is often added. In my
professional opinion a bad solution.

Again, I strongly believe that this would be a huge improvement and
avoids unnecessary network traffic.

Cheers
Michael

-- 

Binary Kitchen
Michael Heuberger
4c Dunbar Road
Mt Eden
Auckland 1024
(New Zealand)

Mobile (text only) ...  +64 21 261 89 81
Email ................  michael@binarykitchen.com
Website ..............  http://www.binarykitchen.com

Received on Friday, 23 May 2014 06:53:22 UTC