Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. $('#goButton').click(function(e){
  2. $('#hello').empty();
  3. $('#hello').append($('<img />').attr({
  4. src: "http://www.vision-call.co.uk/images/stories/events/sample.jpg",
  5. onload: "alert('hello');"
  6. }));
  7. });
  8.  
  9.  
  10. $('img').load(function() {
  11. alert("jquery");
  12. });
  13.  
  14. $('#goButton').click(function(e){
  15. $('#hello').empty();
  16. var newImage = $('<img />').attr({
  17. src: "http://www.vision-call.co.uk/images/stories/events/sample.jpg",
  18. onload: "alert('hello');"
  19. }).on('load', function() {
  20. alert("jquery");
  21. });
  22.  
  23. $('#hello').append(newImage);
  24. });
  25.  
  26. $('#goButton').click(function(e){
  27. $('#hello').empty();
  28. $('#hello').append($('<img />').attr({
  29. src: "http://www.vision-call.co.uk/images/stories/events/sample.jpg",
  30. onload: "alert('hello');"
  31. })).promise().done(function(){alert("jquery");});
  32. });
  33.  
  34. $('#goButton').click(function(e){
  35. $('#hello').empty();
  36. $('#hello').append($('<img />').attr({
  37. src: "http://www.vision-call.co.uk/images/stories/events/sample.jpg",
  38. onload: "loader()"
  39. }));
  40. });
  41.  
  42. var loader = function() {
  43. alert('hello');
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement