File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Loading image using javascript and timeout. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Loading image using javascript and timeout." Watch "Loading image using javascript and timeout." New topic
Author

Loading image using javascript and timeout.

pawan chopra
Ranch Hand

Joined: Jan 23, 2008
Posts: 410

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?


Pawan Chopra
SCJP - DuMmIeS mInD
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Cancel the download of what? Are you looking to adjust the amount of time the browser will wait while it downloads the images? Why?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
pawan chopra
Ranch Hand

Joined: Jan 23, 2008
Posts: 410

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.
 
Don't get me started about those stupid light bulbs.
 
subject: Loading image using javascript and timeout.
 
Similar Threads
javascript and session info
how to check if image is loaded or not
borwsers stop button
Dynamically know the image file not found
Redirect