Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. how to verify is a website is up using javascript

how to verify is a website is up using javascript

Scheduled Pinned Locked Moved Web Development
questionjavascripttutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ricardojb
    wrote on last edited by
    #1

    We have a web page with some javascript that displays information from an external site, occassionally, the external website is down and that slows down our site. We would like to either be able to test if the site is up before executing the javascript code, or implement some form of timeout mechanism (not what is defined as timeOut in javascript, which is really a sleep function), it would actually mean that if the website doesn't respond in a certain interval of time, we could either show a message or just bypass the execution all together. I haven't been able to find anything on this, any ideas?

    V 1 Reply Last reply
    0
    • R ricardojb

      We have a web page with some javascript that displays information from an external site, occassionally, the external website is down and that slows down our site. We would like to either be able to test if the site is up before executing the javascript code, or implement some form of timeout mechanism (not what is defined as timeOut in javascript, which is really a sleep function), it would actually mean that if the website doesn't respond in a certain interval of time, we could either show a message or just bypass the execution all together. I haven't been able to find anything on this, any ideas?

      V Offline
      V Offline
      Vasudevan Deepak Kumar
      wrote on last edited by
      #2

      Send a dummy XmlHttpRequest to the resource and you can examine the status code. Vasudevan Deepak Kumar Personal Web: http://www.lavanyadeepak.tk/ I Blog At: http://www.dotnetjunkies.com/weblog/deepak/
      http://deepakvasudevan.blogspot.com/
      http://deepak.blogdrive.com/

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups