Created
March 2, 2010 11:05
-
-
Save kares/319433 to your computer and use it in GitHub Desktop.
loaded callback for script.js
This file contains 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 characters
function removeGistStyleLink(writes) { | |
// removing embed.css | |
if ( writes ) { // defered load | |
for (var i=0; i<writes.length; i++) { | |
var tagStart = writes[i].substring(0, 5); | |
if (tagStart.toLowerCase() == '<link') { | |
writes[i] = ''; break; // only 1 css | |
} | |
} | |
} | |
else { // loaded in-place | |
var linkNode = this.nextSibling; | |
while (linkNode && linkNode.nodeName.toLowerCase() != 'link') { | |
linkNode = linkNode.nextSibling; | |
} | |
if (linkNode) linkNode.parentNode.removeChild(linkNode); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment