Dear Sirs!
I need to disable the browser back-button in my Prime Faces 7 / Sapphire application run under Wildfly 17. I tried all options (including comments) from the question below, but nothing happened:
https://stackoverflow.com/questions/759 ... pplication
Could you please help me?
Thank you and kind regards,
Alex
Disable the browser back-button in Prime Faces 7 / Sapphire application
Forum rules
Please note that response time for technical support is within 3-5 business days.
Please note that response time for technical support is within 3-5 business days.
-
- Posts: 40
- Joined: 02 Mar 2014, 12:26
Dear Mr. olgubasak!
I have updated my Primefaces to Version 12 and my Sapphire Template to Version 5.1, but the problem still persists.
What would you advise me?
Thank you and kind regards,
Alexander
I have updated my Primefaces to Version 12 and my Sapphire Template to Version 5.1, but the problem still persists.
What would you advise me?
Thank you and kind regards,
Alexander
Hi,
When I did research on your request, I found two separate code examples that you can use. Can you try the ones I sent?
This code moves the page forward in response to the browser's back button being clicked, which effectively disables the back button.
Another code:
This JavaScript code disables the browser's back button as soon as the page loads.
I hope one of these codes solves your problem.
Best Regards,
When I did research on your request, I found two separate code examples that you can use. Can you try the ones I sent?
This code moves the page forward in response to the browser's back button being clicked, which effectively disables the back button.
Code: Select all
history.pushState(null, null, location.href);
window.onpopstate = function () {
history.go(1);
};
Another code:
This JavaScript code disables the browser's back button as soon as the page loads.
Code: Select all
window.onload = function() {
if (typeof history.pushState === "function") {
history.pushState("disabled", null, null);
window.onpopstate = function() {
history.pushState("disabled", null, null);
};
}
};
Best Regards,
-
- Information
-
Who is online
Users browsing this forum: No registered users and 1 guest