Re: [whatwg] HTTP status code from JavaScript

> - Notify the administrator about a 404 by email with a response back to
> the server

But the server already knows about the 404, JS shouldn’t be needed/used to re-inform the server of the status it’s already sent.

> - 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 …

I agree with those entirely but couldn’t they also be achieved by including the correct scripts on the 404 page issued from the server?

(I’m not against the original suggestion, I just don’t think these particular use-cases demand a new feature)

Mat Carey
07952258096

On 23 May 2014, at 07:52, Michael Heuberger <michael.heuberger@binarykitchen.com> wrote:

> 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 07:50:29 UTC