0

i have a url in browser which has few parameter values.what i am trying to do is i want to change that parameter value to true and append back to url bar.

for example i have the url:http://localhost:8080/movie/genre?genereId=61491607&saved=false and i have save button, when i click on the save button, i should change the current url parameter &saved=false to &saved=true

how to do it?

here is what i have tried

url:http://localhost:8080/movie/genre?genereId=61491607&saved=false

<button class="save">save</button>

$('.save').click(function(){
    var defaultURL = window.location.href;
    //taking current url and changing the parameter value 
    location.hash = "saved=abc";
});
CJAY
  • 6,989
  • 18
  • 64
  • 106

0 Answers0