W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2014

Re: [whatwg] HTTP status code from JavaScript

From: Mat Carey <mat@matcarey.co.uk>
Date: Fri, 23 May 2014 08:49:59 +0100
Message-Id: <43D7285A-3327-43BF-81E3-8708B9828B42@matcarey.co.uk>
To: Michael Heuberger <michael.heuberger@binarykitchen.com>
Cc: whatwg@lists.whatwg.org

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

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:28 UTC