Solved

Check if a URL exist

Posted on 2000-03-01
5
732 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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
Course of the Month10 days, 21 hours left to enroll

628 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