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
/*@cc_on @*/ | |
/* if IE, do nothing (error 8004004, whatever that is) */ | |
/*@if (@_jscript_version > 0) | |
@else @*/ | |
document.getCurrentScript = function(){ | |
// fails when document.write nests like | |
// document.write('<'+'script'+'>' +'document.write(...)' + '</'+'script'+'>') | |
return (function (e) { | |
if (!e) return null // gracefully report failure | |
if (e.nodeName.toLowerCase() == 'script') return e; |