Solved

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

Posted on 2003-10-28
7
976 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
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

896 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now