Solved

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

Posted on 2003-10-28
7
973 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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 …
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…

760 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

25 Experts available now in Live!

Get 1:1 Help Now