Check it url / file exists - with Jquery

by Chintan Upadhayay

JavaScript

$.ajax({
        url:'https://youtu.be/-V0qIrNNKtU',
        error: function()
        {
           alert('file does not exists');
        },
        success: function()
        {
            alert('file exists');
        }
    });

// Now to check if file exists call function
checkIfRemoteFileExists('https://youtu.be/-V0qIrNNKtU');

checkIfRemoteFileExists('http://www.google.de');