Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2003-10-28
7
Medium Priority
?
988 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…

876 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