0

I have the following situation in my mobile web application:

  1. I have a javascript Image on the page called srcImage.
  2. I have javascript code that is set to fire when the javascript image gets loaded. My understanding is that this event should be triggered whenever srcImage.src is set to a valid image.
  3. I have a jquery mobile pageshow event on the page that is triggered each time the page is visited. In this event, I sent srcImage.src to a valid image.
  4. The issue I am having is that if I go back to the page (after visiting it once), then the load event for srcImage is not triggered in IE 10. My understanding is that the load event should be triggered in this situation but it is not. Can someone explain why?

     <script>
     var srcImage = new Image();
     $(srcImage).load(function() {
     ...
     });
    $(document).on("pageshow", '#pageid', function() {
      srcImage.src = pathtoimage;
    });
    </script>
    
Obi Wan
  • 889
  • 10
  • 26
  • The load() method is known to have poor cross-browser functionality: http://api.jquery.com/load-event You may need to find a different approach. – isherwood Oct 22 '13 at 14:54

1 Answers1

0

I found the issue, which is that the image being loaded into the Image() control was not valid after all. When using a valid image file it works fine.

Obi Wan
  • 889
  • 10
  • 26