Dynamic Flash generated favicon
// February 27th, 2009 // Experiments, Source code & tutorials
Via Bnox I saw that you can change your favicon dynamically. After some research I found out that the magic trick lays in 3 lines of javascript:
(fi = the path to the favicon )
function setFavIcon(fi) { var icon=document.getElementById('favicon'); (newIcon = icon.cloneNode(true)).setAttribute('href',fi); icon.parentNode.replaceChild(newIcon,icon); }
Sadly, it only seems to work in FireFox and Opera. If you have a solution for this problem, please leave a comment.
Since Flash easily can generate png’s and talk to Javascript, that called for a little experiment:
You can draw your own favicon for this site on the canvas below. It updates automatically.











Ya lo he visto ^^
Sorry Eric, my Spanish isn’t that good. what do you mean?
hehe echt te bizar
ik kan er echt totaal geen functie voor verzinnen, maar toch leuk