I am doing validation for my Youtube url text field.
I need to check, if the Youtube url does not exist I should throw error, I followed this answer an
Youtube
Try this on client side:
//here, oABCD01234 is YouTube id $.ajax({ type: 'HEAD', url: 'http://gdata.youtube.com/feeds/api/videos/oABCD01234', success: function() { //it exists! }, error: function(jqXhr) { if(jqXhr.status == 400) { //it doesn't exist } } });