You don't need jQuery for that purpose. You can use just some pure JavaScript:
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, "
"));
}
Usage:
Suppose your borwser url is: https://www.facebook.com/sharepointTipsTricks?location=india
var Location = getParameterByName('location'); // Location = india
No comments:
Post a Comment