473,406 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Accessing http header in javascript

Is there any way to access arbitrary http header information through
javascript? For example, if I wanted to obtain content-length? I
suspect not, but I'm not too knowledgable on js.

Thanks,
Mark

Jul 18 '06 #1
2 5101
If absolutely necessary, and the browser has XMLHttpRequest support,
you could send out a request for the same page again (note that's an
extra server request). You'll get all the response headers, via the
XMLHttpRequest->getAllResponseHeaders() or
XMLHttpRequest->getResponseHeader("headername") functions

Reference:
http://www.w3schools.com/dom/dom_http.asp

mn******@gmail.com wrote:
Is there any way to access arbitrary http header information through
javascript? For example, if I wanted to obtain content-length? I
suspect not, but I'm not too knowledgable on js.

Thanks,
Mark
Jul 18 '06 #2
JRS: In article <11**********************@b28g2000cwb.googlegroups .com>
, dated Tue, 18 Jul 2006 12:44:53 remote, seen in
news:comp.lang.javascript, mn******@gmail.com posted :
>Is there any way to access arbitrary http header information through
javascript? For example, if I wanted to obtain content-length? I
suspect not, but I'm not too knowledgable on js.
<FAQENTRY>

Header information is important, and ISTM that it would be useful to be
able to find out about how to access it, starting by reading the FAQ -
so a suitable link would do.

I see three possibilities worth presenting :
code for using XMLHttpRequest;
a utility program which, given a URL,
will fetch the header material;
Telnet code
but there may be more.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/>? JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Don | last post by:
I had my host map "domainA.com" to folder "domainB.com/folder". I'm finding when accessing "domainA.com" that PHP scripts which utilize $_COOKIE aren't able to see the cookies belonging to...
1
by: Salek Talangi | last post by:
Hello, I have following (probably very basic) problem: I made a html-frameset in VS.net, where the frames itself are aspx-pages with webforms. Now I want to access the webforms (eg. give a label...
0
by: sonu | last post by:
I have following client side code which i have used in my asp.net project SummaryFeatured Resources from the IBM Business Values Solution Center WHITEPAPER : CRM Done Right Improve the...
0
by: Keith | last post by:
I have a repeater control that contains a HeaderTemplate and an ItemTemplate. Each item contains a checkbox with an ID of chkReconciled, and the header contains a single checkbox with an ID of...
0
by: Keith | last post by:
I have a repeater control that contains a HeaderTemplate and an ItemTemplate. Each item contains a checkbox with an ID of chkReconciled, and the header contains a single checkbox with an ID of...
2
by: William van Zwanenberg | last post by:
Hi there, I wonder if you guys can help. I'm currently experiencing some coding problems what with trying to use PHP and javascript in tandem. What I'm ultimately trying to achieve is use...
7
by: simchajoy2000 | last post by:
Hi, I am just a javascript beginner so maybe this is a simple problem but I am trying to do some rollovers on images in a separate <div>. Here is the relevent piece of my code: <html>...
3
by: HugeBob | last post by:
Hi All, Is it possible to access the browser's print header/footer. I want to create a printable version of a page and alter the printout's header and footer. Is this possible? Thanks!
0
by: nyathancha | last post by:
Hi, I am wondering if there is anyway of easily accessing the messageID that gets posted in the soap header with wse 3.0 I built a custom filter on the client for debugging purposes and I can...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.