This commit is contained in:
2023-08-30 12:29:26 +03:00
parent e19c9610e8
commit 411568fecd
2 changed files with 15 additions and 7 deletions

View File

@@ -92,29 +92,33 @@ function forloop_func_form (data,get,str) {
if (old_val){
data["type_transport"] = `${data["type_transport"]},${value_el}`
if (get !== null){
str.replace(`type_transport=${old_val}`,`type_transport=${old_val},${value_el}/`)
// let new_old_val = old_val.replace("", )
let new_str = str.replace(`type_transport=${old_val}`,`type_transport=${old_val},${value_el}`)
str = new_str
// str.replace(`type_transport=${new_old_val}&`,"")
}
} else {
data[name_el] = value_el
if (get !== null){
str = `${str}${name_el}=${value_el}/`
str = `${str}${name_el}=${value_el}&`
}
}
}
} else {
data[name_el] = ""
str = `${str}${name_el}=""/`
}
} else {
let name_el = name_attr.value
data[name_el] = value_el
str = `${str}${name_el}=${value_el}/`
str = `${str}${name_el}=${value_el}&`
}
}
}
if (!data["type_transport"]){
data["type_transport"] = ""
str = `${str}type_transport=""&`
}
if (get !== null){
let list = [data,str]
return list

View File

@@ -23,7 +23,11 @@ function filters_func_find_route_main (el){
} else {
document.querySelector(".block-finded-routes").innerHTML = data.html
}
// window.location.href = window.location.href + "?" + JSON.stringify(data_d)
// window.location.href = window.location.href + "?" + get_url
// window.location.search = "?" + get_url
history.pushState({'data':data_d,'str_data':get_url}, "state_filters", `?${get_url}`);
// window.history.pushState({data:get_url
// },{})
},
errors: function (data){