Re: [whatwg] HTTP status code from JavaScript

Hi James

Single page apps!

These become more and more popular with frameworks like RactiveJS or
AngularJS. There the first request is a HTTP request, for any subsequent
requests an AJAX one is generated. The problem is the first HTTP
request. The framework is unable to detect 404s with the first request
because the status code cannot be obtained via JavaScript, hence a
second request is made.

In my eyes, a waste of bandwidth.

Cheers
Michael

On 23/05/14 16:39, James Greene wrote:
> I'm not opposed to this idea but... what Is a realistic use case for this?
>
> Sincerely,
>     James Greene
>
>
>
> On Thu, May 22, 2014 at 10:36 PM, Michael Heuberger <
> michael.heuberger@binarykitchen.com> wrote:
>
>> Hello WhatWG
>>
>> There is a need to obtain the HTTP status code for the page itself from
>> JavaScript:
>> https://bugzilla.mozilla.org/show_bug.cgi?id=999886
>>
>> I think this would be a great feature to save additional traffic in an
>> already congested internet. Because I see lots of queries made by
>> XMLHttpRequest solely to obtain the HTTP status code of the same URL.
>>
>> If the global browser variable (JavaScript) would already hold the
>> status code, then these queries would become obsolete and the internet
>> becomes a bit less blocked.
>>
>> Let me know how to proceed with my proposal within WhatWG.
>>
>> Greetings from Auckland,
>> 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
>>
>>

-- 

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 04:53:32 UTC