Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>Test Page</title>
<style>
  body {
    font-family: sans-serif;
  }
</style>
</head>
<body>
   <div id="test">
  <img src="http://srv-live-03.lazada.co.th/p/tangems-3663-219892-1-catalog.jpg">
  <p>When you see the image above, 
  <input type="button" id="theButton" value="Click Me"></p>
  </div>
</body>
</html>
 
jQuery(function($) {
  $("#theButton").click(function() {
    $("#theButton").hide();
    var img = document.createElement('img');
    $(img).load(function() {
      display("Image <code>load</code> event received");
    });
    img.src = "";
    document.body.appendChild(img);
    alert('loaded');
    var immg="http://dbk.theaugmente.com/AppImages/HIDC/46/HPag_1.png"; document.createElement('img');
    $(immg).load(function() {
      showing("show the images");
    });
    immg.src = "http://dbk.theaugmente.com/AppImages/HIDC/46/HPag_1.png";
    document.body.appendChild(immg);
    //alert('se');
    $("#theButton").show();
  });
  
  function display(msg) {
    $("<p>").html(msg).appendTo(document.body);
  }
  
  function showing(msg)
  {
     $("<p>").html(msg).appendTo(document.body);
  }
});
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers