It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

How do you verify a HTML server link is valid ?

How do you verify a HTML server link is valid ?

Postby BobK on Wed Sep 12, 2007 2:27 pm

I am working on an application which needs to verify that a remote HTML server is operational before I open a page to it. The problem I have is once you open a page without first verifying its working, IE tells you there is a problem in their own returned page which kills my application. Therefore, I need to test before redirection.
Does anyone have any suggestions ?

Thanks,
Bob
BobK
 
Posts: 4
Joined: Wed Sep 12, 2007 2:05 pm
Location: East Coast, USA

Postby bobbyblades on Wed Sep 12, 2007 6:42 pm

sounds like you may need to use php in a hidden iframe which checks if the file(url) is able to be opened, if the file is able to be opened, then it should be assumed the server is operational then php would print some sort of javascript command and relay it back to the iframe's parent window. I'm pretty sure that it cannot be done with pure javascript, and you will need a server side language.
User avatar
bobbyblades
50+ Club
 
Posts: 85
Joined: Fri Aug 24, 2007 8:38 pm
Location: hawaii or bust

Re: How do you verify a HTML server link is valid ?

Postby BobK on Thu Sep 13, 2007 7:17 pm

Thanks for the php info. I took a look at what and how php works, and it got me to thinking, this looks like the type of commands XML can do. I did some searching of Javascript with XML and came up with the XMLHttpRequest Object. My servers support XML or SOAP so its a natural to use with Javascript.
Php although a good solution would require more work on my server side than the XML implementation.
The XMLHttpRequest Object allows me to keep the page and make tests in the background before the page is replaced. (exactly on point)
Your post got my brain kick started in the right direction, Thanks Again.
BobK
 
Posts: 4
Joined: Wed Sep 12, 2007 2:05 pm
Location: East Coast, USA

Postby bobbyblades on Thu Sep 13, 2007 7:41 pm

I think you got me thinking about how I need to take an hour and learn XML :lol:
User avatar
bobbyblades
50+ Club
 
Posts: 85
Joined: Fri Aug 24, 2007 8:38 pm
Location: hawaii or bust

Re: How do you verify a HTML server link is valid ?

Postby BobK on Thu Sep 13, 2007 8:50 pm

From my continued reading, this type of XML use is exacty what has been coined AJAX. A fancy name for XML with Javascript. AJAX it seems is completely dependent upon the XMLHttpRequest Object. AJAX is just a way of describing the use of these two items, not an actual language in itself.
BobK
 
Posts: 4
Joined: Wed Sep 12, 2007 2:05 pm
Location: East Coast, USA


Who is online

Users browsing this forum: No registered users and 4 guests