Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    detecting dead servers *before* requesting a script

    hi all,
    i have been searchin all day for a solution for this issue: i am running an ad-server (oasis) which outputs something like this:

    PHP Code:
    echo('document.write("ignore me, i am just ad content no. "' $_GET['id'] . '")'); 
    to those who want to display my ad on their site i give this javascript which requests the above script embeddingcode.php:

    Code:
    <script language="javascript" src="domain/embeddingcode.php?id=10"></script>
    as long as my server is accessible, everything is just fine. but people start complaining when my server is down. some browsers completely stall because domain/embeddingcode.php does not respond.
    the idea is to detect if the server is responding and after that dynamically include the <script></script> section ... AND unfortunately it has to work on old browsers. i can't say "ns 4 users won't ever see my ads", that's why i can't implement a solution for DOM-scripting capable browsers only.

    thanks a lot for any advice,
    olli

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    This is completely off the wall but what about image preloading? If you put an image on the remote server and tried to preload that - would you be able to return something that you can use as a flag? But you've still got to have that <script src> tag in the page... hmmm. Not sure. Sorry

  • #3
    New to the CF scene
    Join Date
    Jun 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi spudhead,
    thanks anyway -- may be this is an issue that can't be covered with javascript.
    best, olli


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •