I am currently in a page that its url is http://localhost:49852/Default.aspx?MID=17
in this page i have the following code
<a href="Configure.aspx"><span class="ico gray shadow gear"></span>Configure</a>
I would like that once the user will click on Configure link the MID parameter from the URL will be cropped and the user will be redirected to
http://localhost:49852/Configure.aspx?MID=17
This is the JS Code
function getParameterByName(name) {
var match = RegExp('[?&]' + name + '=([^&]*)')
.exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}
How do i bind it all together?
First I think you should give your href an id for easy access like:
Then you should be able to change the property with:
This will change the actual href. You could probably just as easily override the click method, but this might be more extensible if you want to change it from the configure link to all links or something.