0

I've tried to catch ajax success or complete when image is loaded from server. I've tried to write something like that, but couldn't get needed result:

$.ajax
 dataType: 'png' #OR mimeType: 'image/png'
 success: ->
  alert 'Success'
 error: ->
  alert 'Error'

Could someone help me please. I completely stack with it. Maybe somebody has faced with same issue. Will be very grateful.

minato
  • 11
  • 4
  • What are you trying to accomplish? What would be done in the success handler (with the data/image)? – Andreas Sep 17 '15 at 22:17
  • @Andreas , I just wanna know, when exactly image is come from remote server. And I want to know, can I do it by additional dataType. Cause now event works with dataType like xhr, script, svg+xml etc... Here're my main goals. – minato Sep 17 '15 at 22:23
  • http://stackoverflow.com/questions/3877027/jquery-callback-on-image-load-even-when-the-image-is-cached , http://stackoverflow.com/questions/280049/javascript-callback-for-knowing-when-an-image-is-loaded – Andreas Sep 17 '15 at 22:27
  • @Andreas , thanks, but these are not I'm looking for... – minato Sep 17 '15 at 22:44

0 Answers0