Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How can I display the header information using JavaScript in my HTML page?

Posted on 2003-10-28
7
Medium Priority
?
984 Views
Last Modified: 2008-03-10
I want to display the Header information in an HTML page I have.  I need to see if the Header information displays error numbers, such as 500 errors.

How can I do this in JavaScript?

Cheers,
Sue
0
Comment
Question by:aspsue
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 3

Expert Comment

by:applekanna
ID: 9637109
what are u using JSP /ASP

if ASP http://www.4guysfromrolla.com/webtech/121400-1.shtml

if JSP <%String head = request.getHeader() ;%>
0
 
LVL 7

Expert Comment

by:Xxavier
ID: 9637232
Is this what you mean?

<html>
<head>
<title>New Page 1</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
</head>
<script>
   document.write(this.GENERATOR.content)
   document.write(document.title)
</script>
<body>
</body>
</html>
0
 
LVL 3

Expert Comment

by:superslamwich
ID: 9637334
um... something like this?

<html>
<head>
<title>Display stuff</title>
</head>
<script type='text/javascript'>
  var val = document.getElementsByTagName('head')[0].outerHTML
  val = val.replace(/</g,"&lt;")
  val = val.replace(/>/g,"&gt;")
  document.write(val)
</script>
<body>
HI
</body>
</html>

{Slam}
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Expert Comment

by:p_partha
ID: 9637460
somethign like this:
var test  = "http://oldlook-search.experts-exchange.com/care/"
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")

xmlhttp.open("HEAD", test,true);
 xmlhttp.onreadystatechange=function() {
  if (xmlhttp.readyState==4) {
   if (xmlhttp.status==200) alert(xmlhttp.status + "URL Exists!")
    else if (xmlhttp.status==404) alert(xmlhttp.status + "URL doesn't exist!")
     else alert("Status is "+xmlhttp.status)
  }
 }
 xmlhttp.send(null)
0
 

Author Comment

by:aspsue
ID: 9644977
These suggestions do not answer my question.

I need a javascript that i can put in my custom error page that will show the HTTP header information.  This the system header information that is sent to the page.

Cheers,
Sue
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 10346162
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

PAQ with points refunded

Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jAy
EE Cleanup Volunteer
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 10377132
PAQed, with points refunded (50)

Computer101
E-E Admin
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question