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

Re: [whatwg] HTTP status code from JavaScript

From: Tobie Langel <tobie.langel@gmail.com>
Date: Sun, 25 May 2014 09:09:27 +0200
Message-ID: <6158177615771046126@unknownmsgid>
To: Michael Heuberger <michael.heuberger@binarykitchen.com>
Cc: "whatwg@lists.whatwg.org" <whatwg@lists.whatwg.org>
On May 25, 2014, at 8:59, Michael Heuberger
<michael.heuberger@binarykitchen.com> wrote:

> Thanks Silvia for your comment but I think we turn in circles.
> I know you mean it well but this is not the case as I mentioned it over
> and over again in my previous emails.
> Let me repeat, the whole SPA of mine is always loaded, no matter if it's
> a 404 or not so that a nice 404 can be rendered on the client-side. No
> piece is missing here. To make this work, Javascript needs to be able to
> have access to the HTTP status code of the initial page load. I can
> count more reasons or read my previous emails.
> Something like `window.http.status` would be really awesome.

Why can't you just set that value server-side (e.g. In a meta tag or
even using a script tag) and retrieve it on the client? E.g. In pseudo

<script>var http = { status: <?php print response->status php>};</script>

Received on Sunday, 25 May 2014 07:09:53 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:20 UTC