[whatwg] HTTP status code from JavaScript

2014-05-22 Thread Michael Heuberger
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 mich...@binarykitchen.com Website .. http://www.binarykitchen.com

Re: [whatwg] HTTP status code from JavaScript

2014-05-23 Thread Michael Heuberger
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 mich...@binarykitchen.com Website .. http

Re: [whatwg] HTTP status code from JavaScript

2014-05-23 Thread Michael Heuberger
a new feature) Mat Carey 07952258096 On 23 May 2014, at 07:52, Michael Heuberger michael.heuber...@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

Re: [whatwg] HTTP status code from JavaScript

2014-05-23 Thread Michael Heuberger
On 23/05/14 20:33, Silvia Pfeiffer wrote: I had to deal with this on a script created IMG element the other day. I used onerror to deal with it. For xmlhttprequest you can use the status field. Why is that not enough? Silvia. On 23 May 2014 18:06, Michael Heuberger michael.heuber

Re: [whatwg] HTTP status code from JavaScript

2014-05-24 Thread Michael Heuberger
Hi David Interesting. Yes and no, I agree with some. See my comments below: On 25/05/14 06:53, David Bruant wrote: Le 23/05/2014 10:04, Michael Heuberger a écrit : - Display a beautiful 404 page and hide parts of the navigation - Reveal navigation history to give users a better usability

Re: [whatwg] HTTP status code from JavaScript

2014-05-25 Thread Michael Heuberger
Pfeiffer wrote: Hi Michael, On Sun, May 25, 2014 at 3:10 PM, Michael Heuberger michael.heuber...@binarykitchen.com wrote: Hi David Interesting. Yes and no, I agree with some. See my comments below: On 25/05/14 06:53, David Bruant wrote: Le 23/05/2014 10:04, Michael Heuberger a écrit

Re: [whatwg] HTTP status code from JavaScript

2014-05-25 Thread Michael Heuberger
` 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: scriptvar http = { status: ?php print response-status php};/script --tobie -- Binary Kitchen Michael Heuberger 4c Dunbar

Re: [whatwg] HTTP status code from JavaScript

2014-05-25 Thread Michael Heuberger
Bonjour David On 25/05/14 23:33, David Bruant wrote: Hi Michael, Le 25/05/2014 07:10, Michael Heuberger a écrit : Look at Angular, their templates reside on the client side. For production, a grunt task can compress all files into one single, huge JS file that is served to the client

Re: [whatwg] HTTP status code from JavaScript

2014-05-25 Thread Michael Heuberger
Hi Tobie On 26/05/14 00:51, Tobie Langel wrote: On May 25, 2014, at 13:48, Michael Heuberger michael.heuber...@binarykitchen.com wrote: * It is a redundancy. The browser already knows the status code, just not JavaScript. That argument can equally well be used the other way round: it's

Re: [whatwg] HTTP status code from JavaScript

2014-05-25 Thread Michael Heuberger
, I'm just making conversation :-) Cool, thanks for sharing and conversing :) Michael -- Binary Kitchen Michael Heuberger 4c Dunbar Road Mt Eden Auckland 1024 (New Zealand) Mobile (text only) ... +64 21 261 89 81 Email mich...@binarykitchen.com Website .. http

Re: [whatwg] HTTP status code from JavaScript

2014-05-25 Thread Michael Heuberger
header. Why not pass it along to JavaScript? IMO this is not really adding a new thing but opening a door. Michael -- Binary Kitchen Michael Heuberger 4c Dunbar Road Mt Eden Auckland 1024 (New Zealand) Mobile (text only) ... +64 21 261 89 81 Email mich...@binarykitchen.com Website

Re: [whatwg] HTTP status code from JavaScript

2014-05-25 Thread Michael Heuberger
of configuring it to modify the response codes for certain requests, but not the response body? nginx + node.js with ExpressJS Michael -- Binary Kitchen Michael Heuberger 4c Dunbar Road Mt Eden Auckland 1024 (New Zealand) Mobile (text only) ... +64 21 261 89 81 Email mich

Re: [whatwg] HTTP status code from JavaScript

2014-05-25 Thread Michael Heuberger
. What server are you using here? Does it have a way of configuring it to modify the response codes for certain requests, but not the response body? nginx + node.js with ExpressJS Michael -- Binary Kitchen Michael Heuberger 4c Dunbar Road Mt Eden Auckland 1024 (New Zealand) Mobile (text

Re: [whatwg] HTTP status code from JavaScript

2014-05-25 Thread Michael Heuberger
23 mai 2014 à 12:36, Michael Heuberger michael.heuber...@binarykitchen.com a écrit : 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 We could do better. HTTP Code is yet another very specific bit

Re: [whatwg] HTTP status code from JavaScript

2014-05-26 Thread Michael Heuberger
grateful for your good comments that make me think a lot. -- Binary Kitchen Michael Heuberger 4c Dunbar Road Mt Eden Auckland 1024 (New Zealand) Mobile (text only) ... +64 21 261 89 81 Email mich...@binarykitchen.com Website .. http://www.binarykitchen.com

Re: [whatwg] HTTP status code from JavaScript

2014-05-26 Thread Michael Heuberger
On 26 May 2014 12:09, David Bruant bruan...@gmail.com mailto:bruan...@gmail.com wrote: Le 26/05/2014 01:52, Michael Heuberger a écrit : Serving different content based on different URLs (and status

Re: [whatwg] HTTP status code from JavaScript

2014-05-26 Thread Michael Heuberger
to polyfill in older browsers using the duplicate AJAX request hack that Michael is using today (or a server-side generated inline script block if you want guaranteed correctness). Sincerely, James Greene Sent from my [smart?]phone On May 26, 2014 6:37 PM, Michael Heuberger