Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Check if a URL exist

Posted on 2000-03-01
5
Medium Priority
?
748 Views
Last Modified: 2012-05-04
I have a JavaScript function with two different URLs. The first URL is the default URL and the JavaScript jumps to it, but if the first URL does not exist, the JavaScript must jump to the second one. I need a function that checks if the first URL exist and depending the result of this function, jump to the first or the second URL.
0
Comment
Question by:aikon
  • 3
  • 2
5 Comments
 

Accepted Solution

by:
Deathead earned 150 total points
ID: 2585024
Unfortunatly JS can't supply that information for you
0
 

Expert Comment

by:Deathead
ID: 2585034
Unfortunatly JS can't supply that information for you
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 2601499
However if you can put an image on the 1st server, you can try this:

<IMG SRC="http://www.server1.com/testimage.gif"
onLoad="window.location='http://www.server1.com/'"
onError="window.location='http://www.server2.com/'">

Michel
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 2601509
However if you can put an image on the 1st server, you can try this:

<IMG SRC="http://www.server1.com/testimage.gif"
onLoad="window.location='http://www.server1.com/'"
onError="window.location='http://www.server2.com/'">

Michel
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 2601528
Sorry for the double posting - bad response time

Michel
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question