Is there a jQuery event handler that will fire if a GET value is set? The equivalent of php's isset:
i.e.
if(isset($_GET["myValue"])){
}
Is there a jQuery event handler that will fire if a GET value is set? The equivalent of php's isset:
i.e.
if(isset($_GET["myValue"])){
}
You can check location.search
contains your parameter:
if(location.search.indexOf("test=") != -1){
}
Use This function for any $_GET parameter.
function searchCheck(param){
var a = Array();
var b = Array();
if(location.search.length>0){
a= location.search.split('&');
for(var index=0;index<a.length;index++){
b= a[index].split('=');
if(b[0]==param && b[1].toString()>0){
alert(param+" already set");
return true;
}
}
}
alert(param+" not set");
return false;
}