I have a URL with a long query string attached to it. After the page loads, I do not require the query string. So I want to remove the query string from the address bar with
Updated Code Now it will work
Just Add Below code in you page whose link you want to change.
// javascript function
function buildLin(first) {
var firs = first.toString()
//alert(firs);
//document.getElementById("team").value = "1";
document.location.hash = "#" + firs.replace(/ /g, "_");
//alert(document.location.hash);
}
//jQuery to call above function after page loads
$(document).ready(function () {
buildLin(2);
});
Don't forget to add http://code.jquery.com/jquery-latest.js on your page