-
Goal: I try to switch a page with a javascript query.
-
Details: I have a one button which represents the login and logout option. If I logged in, the button changes his text to 'logout'. If nobody is logged in, the button text is 'login'. If I press the button in 'login' state I want to change the page. If I press the button in 'logout' state a logour query will run.
-
I tried to run a javascript query with no success: the script dont change to the loginPage. I could not find any help in the documentation or here. At the moment I solved the problem with two event handlers looking to the flag. But I am very disappointed about can't find a solution with one java script. ChatGPT suggested a utils.navigate() function, but this function does not exist.
// open login page
if (var_userLoggedinStatus.value == false) {
utils.openApp({ pageName: 'loginPage' } );
}
// run logout script
else {
jsQuery_logoutUser.trigger();
}
Can you tell me the right syntax to change a page in a javascript query? It seems very complex. I don't know how!
Greetings Georg