Created
April 1, 2010 04:54
-
-
Save zpoley/351377 to your computer and use it in GitHub Desktop.
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() { | |
window.__SCRIPT ? window.__SCRIPT.index++ : window.__SCRIPT = { index : 0 }; | |
var scriptElement = null; | |
var scriptParams = (function() { | |
var scripts = document.getElementsByTagName("script"); | |
var __SCRIPTS = []; | |
for (var i = 0; (i < scripts.length); i++) { | |
if (scripts[i].src.match("__JSCGI=1")) { | |
__SCRIPTS.push(scripts[i]); | |
} | |
} | |
scriptElement = __SCRIPTS[window.__SCRIPT.index]; | |
var split_src = scriptElement.src.split("?"); | |
split_src.shift(); | |
var raw_params = split_src.join("?").split("&"); | |
var params = {}; | |
for (var i = 0; (i < raw_params.length); i++) { | |
var kv = raw_params[i].split("="); | |
params[unescape(kv[0])] = unescape(kv[1]); | |
} | |
return params; | |
})(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment