Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

link error freezes site

Status
Not open for further replies.

mulufuf

IS-IT--Management
Dec 4, 2001
3
0
0
US
Hi there. I thought this would be an easy one, but i've searched a long while and failed to find what i need.

I have a website which is feeding data to other websites through a simple javascript call similar to:

<SCRIPT LANGUAGE=JAVASCRIPT src=&quot;
For reasons unrelated this server needs to be rebooted everyday for the next couple of weeks, and i would prefer not to hang the feedee pages while our script is unavailable. Is there a straightforward way to add a conditional statement that tests if the domain is up (or the script is available or whatever) before calling the actual script? I don't mind adding the conditional to the code we hand out to feedees, but i cannot find a test for aliveness in javascript. Thanks in advance
 

how about having a .dat file with a value in it...let's say value is 'yes', signifying the domain is current. then on the page, use code to open the .dat file and read it; if the contents read yes, then use the .js file; if 'no' then it doesn't read it.

you manually change the value depending on the accessibility of the domain.

- spewn
 
Thanks for the idea, i appreciate your time. I think it could work, but i would still have to catch the error when my server was down. I just want to check a remote site (ping it, or test for a 550 error or whatever) and then, if it doesn't work, i want to abandon the local script rather than running it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top