Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get current page http status from javascript

Is there any way to get the http status of the current web page from javascript?

Spent some time searching on the web, but no luck at all... Seems like it's not possible, but wanted to check with Stack Overflow for maybe some fancy workaround.

(Providing it from the server as part of the response body is not acceptable, the status is supposed to be only available via the http header)

like image 429
Andrea Zilio Avatar asked Feb 01 '13 20:02

Andrea Zilio


People also ask

How can I get HTTP status code?

Just use Chrome browser. Hit F12 to get developer tools and look at the network tab. Shows you all status codes, whether page was from cache etc.

How do you get fetch status?

To get the status code of an HTTP request made with the fetch method, access the status property on the response object. The response. status property contains the HTTP status code of the response, e.g. 200 for a successful response or 500 for a server error.

How do I get the current page number in Javascript?

var lighboxHeight = (pagenumber-1)*window.

What is http200?

The HTTP 200 OK success status response code indicates that the request has succeeded. A 200 response is cacheable by default. The meaning of a success depends on the HTTP request method: GET : The resource has been fetched and is transmitted in the message body.


1 Answers

This is not in any way possible, sorry.

like image 124
Martin Jespersen Avatar answered Oct 05 '22 22:10

Martin Jespersen