I am new in javascript/jquery, need to hide query strings of anchor tag in my project. Please reply as soon as possible.
<a href="cc/login.htm?loginType=manager">Login</a>
I am new in javascript/jquery, need to hide query strings of anchor tag in my project. Please reply as soon as possible.
<a href="cc/login.htm?loginType=manager">Login</a>
For mouseover, you can add:
<a href="cc/login.htm?loginType=manager" title="Click to login">Login</a>
For hiding querystring in URL, you have to change the way of loginpage. I guess, you could send logintype
variable in a POST and render that variable as a hidden value in the login form (and of course rechecking if that user who is logging in has that manager access).
Or you can just JS change the URL:
window.history.pushState('Login', 'Login', 'cc/login.htm');
Don't store the url in the href and use Ajax to fill in the url and do the GET or jquery/JS to set the document.location.href
$("#linkid").on('click', function (e) {
e.preventDefault();
var loadUrl = "cc/login.htm?loginType=manager";
document.location.href = loadUrl;
return false;
});