Re: [whatwg] HTTP status code from JavaScript

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

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

--tobie

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