Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to check a file is existing in window.location

 
sumanth kumar
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to see if the file exists on the server? Make a head Ajax call with the XMLHttpRequest object to that url.

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic