jquery - Test if a file exists with javascript -
this question has answer here:
this question has been asked here , here. have tried 3 of answers no luck. using system called niagara acting web server, may reason these techniques did not work. nonetheless, feel there must way check existence of file, not existence of 404 or 200 or 0.
you can use $.ajax
$.ajax({ url: 'example.com/abc.html', //or url success: function(data){ alert('exists'); }, error: function(data){ alert('does not exist'); }, })
Comments
Post a Comment