-2

Possible Duplicate:
How to check if a page is exist or not using javascript

can you provide the code for checking the page exist or not.if not,it will redirect to another page.

Community
  • 1
  • 1
anish
  • 325
  • 1
  • 5
  • 8
  • 1
    duplicate of your same question http://stackoverflow.com/questions/3922989/how-to-check-if-a-page-is-exist-or-not-using-javascript – mykhal Oct 13 '10 at 12:31
  • I'm sure someone at freelancer.com or project4hire.com would be more than happy to give you a quote – DJ Quimby Oct 13 '10 at 12:33

1 Answers1

1

The problem is, if the page doesn't exist (the server is given what it considers an invalid url that it cannot satisfy), you will get a 404 error. So no code on any target page is going to run. Instead you have to do this server side, specifying what page to serve instead when a 404 is encountered. It is not done with client-side javascript.

Robusto
  • 31,447
  • 8
  • 56
  • 77