This is not technically a bug. WebKit is just more strict. You must
instantiate a new Image() object before the replacement, like this:
var photo = document.getElementById('image_id');
var img = new Image();
img.addEventListener('load', myFunction, false);
img.src = 'http://newimgsource.jpg';
photo.src = img.src;
This is how it to properly do it for all browsers.
This is not a bug. WebKit is just more strict. You must instantiate a new
None of the solutions above fixed my problem..
i Have a dynamic background image that is changing on clicking different
input buttons
and an onload event (javascript)
the image is generated using PHP and sometimes it is working fine, other
times it flickers :(
i cannot identify when this is happening but on IE5 it is working fine.