Solved

Check if a URL exist

Posted on 2000-03-01
5
700 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 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

912 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now