jquery - javascript : image is not loading in internet explorer -


i trying load simple image using javascript, using following code

function loadimage(src) {     var image = new image;     image.onload = function() {         document.body.appendchild(image);     };     image.onerror = function() {         document.body.appendchild(document.createtextnode('\nerror loading image: ' + this.src));     };     image.src = src; }  loadimage('http://www.linkedin.com/favicon.ico'); loadimage('http://www.facebook.com/favicon.ico'); 

fiddle link

the problem facing whole thing working in chrome , firefox not working in internet explorer. not used javascript.

any solutions ?

ie not load ico image browser unless contenttype image/x-icon.

i can confirm looking @ network tab in firefox contenttype linkedin image application/octet-stream explain why ie not show while facebook image has content type of image/x-icon ie likes.

there nothing can browser other don't request image has type set on server. i'm quite sure sites linkedin have other small images there site can link to.

fyi, if @ linkedin source it's homepage, find tag points http://s.c.lnkd.licdn.com/scds/common/u/images/logos/favicons/v1/16x16/favicon.ico works fine in ie (because it's image/x-icon).


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -