I have a a button with a function that is basically redirectin to another html document and after that is seting up a variable. that is the code
that the function that is redirecting
function polloCheck() {
state.type = "aves";
defaultStatementCategory();
}
/the next function is the addeventlistener************************/
function goCategoryPollo() {
document.location.href = "categoriaAves.html";
window.onload.polloCheck();
}
even if put windows.onload.polloCheck, when I do console.log(state.type) the result it's empty string. (state.type = "") that's the result and default statement aswell.