I know this question is asked many times but none of these solutions worked for me.
What I need to do is to replace the url query string with some other value.
I need to replace ?tab=
from URL. Thats my requirement.
URL:
http://localhost:3000/private_search/search_all?tab=playlists&term=phy&utf8=✓&
rating[]=4&_=1487710144036
I need to make it:
http://localhost:3000/private_search/search_all?tab=featured&term=phy&utf8=✓&rating[]=4&_=1487710144036
http://localhost:3000/private_search/search_all?tab=all_schools&term=phy&
utf8=✓&rating[]=4&_=1487710144036
decodeURIComponent(this.url) returns:
http://localhost:3000/private_search/search_all?tab=playlists&term=phy&utf8=✓&
rating[]=4&_=1487710144036
$("#featured-url").attr('href', decodeURIComponent(this.url)); // need to change url here
$("#school-url").attr('href', decodeURIComponent(this.url)); // need to change url here