added "persitance" of searchbar over request

This commit is contained in:
Askill 2020-05-13 12:02:55 +02:00
parent d03131adf0
commit c77d835fa3
1 changed files with 4 additions and 0 deletions

View File

@ -7,6 +7,10 @@ function checkforURLParam(){
let url = window.location.href
params = url.split("?")[1]
if (params !== undefined){
// url param to string for search bar
paramString = params.split("&").join("").split("ingred=").join(", ").replace(", ", "")
document.getElementById("search-field").value = paramString
params = "?" + params
loadRecipes(params)
}