code:
$(document).ready(function(){
$("#search_result").change(function(){
str = $(this).val();
search = str.replace(/%20/g, "+");
window.location.href = "courses.php?search-result="+search
});
});
In this code I have a dropdown where I have multiple values and now I want to pass dropdown values in url using window.location.href. Now, values are passing perfectly but I want to replace (%20) with (+). I am using str.replace function but not able to see any changes. So, How can I get my url like.
courses.php?search-result=core+java