aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes How to check a file is existing in window.location Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to check a file is existing in window.location" Watch "How to check a file is existing in window.location" New topic
Author

How to check a file is existing in window.location

sumanth kumar
Greenhorn

Joined: Jul 29, 2005
Posts: 22
I've a request that when user hit a url ("https://host:port/IDSearch.html"), first we need to search another file in that location (Where IDSearch.html) is available. If that file is available we need to load that file instead of IDSearch.html. how can we do that? Can we do this in javascript code in IDSearch.html? please advice.
Or any alternate way to check the file and load?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You need to see if the file exists on the server? Make a head Ajax call with the XMLHttpRequest object to that url.

Eric
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to check a file is existing in window.location