title: How do I check if a video exists on YouTube, in client side
body: <p>I am doing <a href="https://stackoverflow.com/q/28735459/1877909">validation for my <code>Youtube</code> url text field</a>. </p>
  
  <p>I need to check, if the <code>Youtube</code> url does not exist I should throw error, I followed this <a href="https://stackoverflow.com/a/1383115/1877909">answer</a> and created the <a href="http://jsfiddle.net/hiteshbhilai2010/vzysD/60/" rel="noreferrer">jsfiddle</a> to check it.</p>
  
  <p>It works for valid url but it does not work for invalid url. All I see is 404 error in <code>network console</code> </p>
  
  <p><img src="https://i.stack.imgur.com/jlT1K.png" alt="enter image description here"></p>
  
  <p>Is there a way to check if url exist in client side using <code>JavaScript</code> and <code>jQuery</code>. </p>
  
  <p>here is my code : </p>
  
  <pre><code>var videoID = 'kn8yzJITdvI';//not working 
  //var videoID = 'p4kIwWHP8Vc';//working 
  $.ajax({
      url: "https://gdata.youtube.com/feeds/api/videos/" + videoID + "?v=2&amp;alt=json",
      dataType: "jsonp",
      success: function(data) {
          console.log(data)
            $("#result").text(data);
      },
      error: function(jqXHR, textStatus, errorThrown)
                      {
                          // Handle errors here
                          alert('ERRORS: ' + textStatus);
  
                      }
  });
  </code></pre>
  
  <p><strong><a href="http://jsfiddle.net/hiteshbhilai2010/vzysD/60/" rel="noreferrer">JSfiddle Link</a></strong> </p>