-
-
Save jeandcr/484cfc0f6c135edddd8b681c63a5bec3 to your computer and use it in GitHub Desktop.
Revisions
-
mathiasbynens revised this gist
Apr 29, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ */ // HTML5™, baby! http://mathiasbynens.be/notes/document-head document.head || (document.head = document.getElementsByTagName('head')[0]); function changeFavicon(src) { var link = document.createElement('link'), -
mathiasbynens revised this gist
Apr 29, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ */ // HTML5™, baby! http://mathiasbynens.be/notes/document-head document.head || document.head = document.getElementsByTagName('head')[0]; function changeFavicon(src) { var link = document.createElement('link'), -
mathiasbynens renamed this gist
Apr 29, 2011 . 1 changed file with 2 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,16 +7,6 @@ // HTML5™, baby! http://mathiasbynens.be/notes/document-head document.head = document.head || document.getElementsByTagName('head')[0]; function changeFavicon(src) { var link = document.createElement('link'), oldLink = document.getElementById('dynamic-favicon'); @@ -25,9 +15,6 @@ function changeFavicon(src) { link.href = src; if (oldLink) { document.head.removeChild(oldLink); } document.head.appendChild(link); } -
mathiasbynens revised this gist
Jun 7, 2010 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,8 @@ document.head = document.head || document.getElementsByTagName('head')[0]; // Browser sniffing :`( // Need to match Chromium and Chrome if (/Chrom/.test(navigator.userAgent)) { var isChrome = 1, iframe = document.createElement('iframe'); iframe.src = 'about:blank'; -
mathiasbynens created this gist
Jun 7, 2010 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ /*! * Dynamically changing favicons with JavaScript * Works in all A-grade browsers except Safari and Internet Explorer * Demo: http://mathiasbynens.be/demo/dynamic-favicons */ // HTML5™, baby! http://mathiasbynens.be/notes/document-head document.head = document.head || document.getElementsByTagName('head')[0]; // Browser sniffing :`( if (/Chrome/.test(navigator.userAgent)) { var isChrome = 1, iframe = document.createElement('iframe'); iframe.src = 'about:blank'; iframe.style.display = 'none'; document.body.appendChild(iframe); }; function changeFavicon(src) { var link = document.createElement('link'), oldLink = document.getElementById('dynamic-favicon'); link.id = 'dynamic-favicon'; link.rel = 'shortcut icon'; link.href = src; if (oldLink) { document.head.removeChild(oldLink); }; document.head.appendChild(link); if (isChrome) { iframe.src += ''; }; };