Function for accessing URL variables in HTML:
function getUrlVar(key){
var result = new RegExp(key + "=([^&]*)", "i").exec(window.location.search);
return result && unescape(result[1]) || "";
}
Ex:
URL: http://blog.com?name=suresh&lastname=raja
you have to use the function like this getUrlVal('name') you will get the result as 'suresh'.
function getUrlVar(key){
var result = new RegExp(key + "=([^&]*)", "i").exec(window.location.search);
return result && unescape(result[1]) || "";
}
Ex:
URL: http://blog.com?name=suresh&lastname=raja
you have to use the function like this getUrlVal('name') you will get the result as 'suresh'.