Witam.
Chciałbym przy użyciu jquery dodać parametr do adresu http. I udało mi się wykombinować coś takiego:
function change_comapny() {
str = $("select#company_to_show option:selected").val();
var url = window.location.href;
location.replace(url+"&change_comapny_to_show="+str);
}
z tym, że gdybym wykonał funkcję change_comapny() kilka razy mój string stawałby się coraz dłuższy.
- url+"&change_comapny_to_show="+str
- url+"&change_comapny_to_show=str&change_comapny_to_show="+str
- url+"&change_comapny_to_show=str&change_comapny_to_show=str&change_comapny_to_show="+str itd.
Jak temu zaradzić ? :)