4 | I want after load image, alert some, but here is 1 problem: as I know, if img is saved in browser cache,img.onload event will be not called. So, how solve this problem, how make alert after every refresh document, despite img saved in browser cache or not, tell please someone.
|
49 | As you're generating the image dynamically, set the
Fiddle - tested on latest Firefox and Chrome releases. You can also use the answer in this post, which I adapted for a single dynamically generated image:
|
There are two possible solutions for these kind of situations:
In this code every time adding current timestamp to the end of the image URL you make it unique and browser will download the image again |
I want to do:
But the load event doesn't fire when the image is loaded from cache. The jQuery docs suggest a plugin to fix this, but it doesn't workactive |
If the
Note the change from |
'javascript' 카테고리의 다른 글
자바스크립트 상속!! 후......ㅠ (0) | 2016.07.21 |
---|---|
apply call (0) | 2016.07.21 |
apply, call 상속하기 (0) | 2016.07.18 |
클로저의 힘을 느껴보자!! (0) | 2016.07.18 |
간단한 호이스팅 설명 (0) | 2016.07.18 |