Solved

Check if a URL exist

Posted on 2000-03-01
5
698 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
Comment Utility
Unfortunatly JS can't supply that information for you
0
 

Expert Comment

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

Expert Comment

by:Michel Plungjan
Comment Utility
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
Comment Utility
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
Comment Utility
Sorry for the double posting - bad response time

Michel
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

743 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

10 Experts available now in Live!

Get 1:1 Help Now