Use the load
event:
img = new Image();
img.onload = function(){
// image has been loaded
};
img.src = image_url;
Also have a look at:
More Related Contents:
- jQuery doesn’t give a proper output, but gives these [closed]
- Cannot read property ‘addEventListener’ of null using querySelector [closed]
- Please anyone tell me what i do that my website display date and time not get reset on refreshing the page
- contenteditable change events
- When is JavaScript synchronous?
- Adding options to a using jQuery?
- Is it possible to listen to a “style change” event?
- No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘…’ is therefore not allowed access
- Avoid dropdown menu close on click inside
- How to properly use jsPDF library
- How to disable text selection using jQuery?
- How to get the element clicked (for the whole document)?
- How to clear the contents of an iFrame from another iFrame
- Displaying a number in Indian format using Javascript
- Simulate Keypress With jQuery
- Javascript reload the page with hash value
- How can I make an AngularJS directive to stopPropagation?
- jQuery: get data attribute
- How do I automatically play a Youtube video (IFrame API) muted?
- jQuery Drag/Resize with CSS Transform Scale
- I want to store Javascript array as a Cookie
- Remove table row after clicking table row delete button
- jQuery ajax load() java script not executing?
- Format a JavaScript string using placeholders and an object of substitutions?
- Disable “Changes you made may not be saved” pop-up window
- JavaScript break sentence by words
- iframe Auto Adjust Height as content changes
- Run jQuery code after AngularJS completes rendering HTML
- How to Bootstrap navbar static to fixed on scroll?
- ‘append’ called on an object that does not implement interface FormData