I am calling a .js file within a HTML file. On the URL to the .js file I want to include a parameter that will be accessable to the code INSIDE the .js file.
For exa
function getUrlVars()
{
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href
.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
Source: http://snipplr.com/view.php?codeview&id=799