Thanks! and sorry for not looking at that first.
However, I have come to the same conclusion as Okham did in that post. I don't quite get it. I tried to implement it but its not working.
Here is what I have:
Code:
<HTML>
<HEAD>
<b><h1><center>Welcome to my Page!</b></h1></center>
</HEAD>
<BODY>
<p><a href="Check1.html">Page 1</a></p>
<p><a href="Check2.html">Page 2</a></p>
<p>The first site is: </p>
<script type="text/javascript">
var sURL = Check1+".html";
oRequest.open("GET",sURL,false);
oRequest.setRequestHeader("User-Agent",navigator.userAgent);
oRequest.send(null)
if (oRequest.status==200) var str = oRequest.responseText;
else alert("Error executing XMLHttpRequest call!");
var result = str.search(/down/i);
// I want to queury Check1.html to see if "down" is present, and then
// display an image accordingly. What I have here does not work.
if(result == -1)
// if "down" is not found, then the site is up.
{
document.write('<img src="Up.png" width ="100" height ="100" alt="Error"/>');
}
else
// if "down" is found, then the site is down.
{
document.write('<img src="Down.png" width ="100" height ="100" alt="Error"/>');
}
</script>
<p>The second site is: </p>
<script type="text/javascript">
// if the word "up" is found on "Check_Down.html" then display "up.jpg"
// else if the word "down" is found on "Check_Down.html" then display "down.jpg"
</script>
</BODY>
</HTML>
Please take a look at my code. There are comments where I having trouble.
Don't get me wrong, I want to learn how it works, but more specific help would be greatly apprciated.
Thanks!
Bookmarks