Posted By

thefricky on 11/02/10


Tagged

ajax check jquery


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

kubaitis
AllKnightAccess
Tyster
Meander365
johnw


Check if a File Exists


 / Published in: jQuery
 

URL: http://www.ambitionlab.com/how-to-check-if-a-file-exists-using-jquery-2010-01-06

Nice jquery script to check if a file exists, written by ambitionlab

  1. $.ajax({
  2. url:'http://www.example.com/somefile.ext',
  3. type:'HEAD',
  4. error:
  5. function(){
  6. //do something depressing
  7. },
  8. success:
  9. function(){
  10. //do something cheerful :)
  11. }
  12. });

Report this snippet  

You need to login to post a comment.