Created
October 6, 2010 14:57
-
-
Save nanodeath/613478 to your computer and use it in GitHub Desktop.
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 characters
<script> | |
if(document.location.href.match(/debug/)){ | |
document.write("<script src=\"external.js\"><\/script>"); | |
} | |
</script> | |
This doesn't work -- the document is loaded asynchronously in Firefox. |
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 characters
<script type="text/javascript"> | |
// here's our runtime variable -- checking for "debug" in querystring | |
if(!document.location.href.match(/debug/)){ | |
document.write("<!--"); | |
} | |
console.log("before script tag") | |
</script> | |
<script type="text/javascript" src="/external.js"></script> | |
<script> | |
console.log("after script tag"); | |
</script> | |
<script> | |
/* --> <script> /**/ | |
</script> |
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 characters
<!-- | |
<script src="/external.js"></script> | |
<!-- --> | |
Even this doesn't quite work -- it works on Chrome, but Firefox prints out "<!--". |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment