• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Loading image using javascript and timeout.

 
pawan chopra
Ranch Hand
Posts: 417
jQuery Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a scenario where I am trying to pre load image and then onload call rest of the javascript. I would like to define some timeout for that. I am not sure how much time browser wait for the image before it actually throws an error. But is there any way I can set a timeout and cancel the download?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cancel the download of what? Are you looking to adjust the amount of time the browser will wait while it downloads the images? Why?
 
pawan chopra
Ranch Hand
Posts: 417
jQuery Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,

Basically I am building a mobile app. It has list of players. You click on one page you get information about that player and image of that player but fetched from a third party rest service. I am using backbone. What is happening is user is able to see the text but image is loading really slow. So now I am trying to do something like this.



But I am not sure how much time browser waits for the image to get loaded. So I wanted to define my own timeout.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic