How do I check if a file on my server exists in jQuery or pure JavaScript?
A similar and more up-to-date approach.
$.get(url) .done(function() { // exists code }).fail(function() { // not exists code })