It's ease to verify the Image exist in given URL or not with the help of Ajax call in JQuery.
Step 1:
Create a HTML Design which is written below:
  1. <html xmlns="http://www.w3.org/1999/xhtml">
  2. <head>
  3. <title></title>
  4. <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
  5. <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
  6. </head>
  7. <body>
  8. <form id="form1">
  9. <div class="container">
  10. <div class="row">
  11. <br>
  12. <div class="form-inline"> <b>Enter Url:</b>
  13. <input type="text" id="txtUrl" />
  14. <input type="button" value="Check Status" id="btnStatus" class="btn-default" /> </div>
  15. </div>
  16. </div>
  17. </form>
  18. </body>
  19. </html>
Step 2: Create a JQuery script to verify the Image present in the URL or Not which is written below:
  1. $(function()
  2. {
  3. $('#btnStatus').click(function()
  4. {
  5. $.ajax(
  6. {
  7. url: $('#txtUrl').val(),
  8. success: function(data)
  9. {
  10. alert('Image Exists');
  11. },
  12. error: function(data)
  13. {
  14. alert('Image does not exist');
  15. }
  16. });
  17. });
  18. })
Result in Browser:

Figure 1



Figure 2


Figure 3