I need to check the values of an empty querystring but I'm doing something wrong :( When the url is index.php for exemple I need it to open the #home but if it is index.php?m=1&s=1 it open #page_1_1
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;
}
var m = getUrlVars()["m"];
var s = getUrlVars()["s"];
if((m!='')&&(s!='')){
$('#page_'+m+'_'+s+'').show();
}
else{ $('#home').show(); }