1

I'm using a system called joget and my question on how to change the following code to make the user first logout and then after logout it will redirect him to another page. I only want to use javascript. First I want to call the logout url in href and then call onclick to move to another page. Any hint on how to apply this:

html += "<dd><a style=\"text-align:center\" href=\"" + data.get("logout_link") + "\" onclick=\"setTimeout(function () { window.location = 'https://abcd.com'; }, 1000);\"><i class=\"fa fa-power-off\"></i> "+ResourceBundleUtil.getMessage("theme.universal.logout")+"</a></dd>\n";
hdalang
  • 33
  • 2
  • When the user clicks on the link, prevent the link's default behaviour and only focus on the onclick function. In the onclick function you will want to make something like a ```XMLHttpRequest``` to the logout url, then when the callback of the request comes back, you will want to change the location to your desired page. – Alain Doe Jan 20 '22 at 11:09

0 Answers0