(function(){ 'use strict'; // http://loopj.com/2010/06/12/simple-way-to-extract-get-params-from-a-javascript-script-tag/ var getParams = function(script_name) { // Find all script tags var scripts = document.getElementsByTagName("script"); // Look through them trying to find ourselves for(var i=0; i -1) { // Get an array of key=value strings of params var pa = scripts[i].src.split("?").pop().split("&"); // Split each key=value into array, the construct js object var p = {}; for(var j=0; j