How to disable browser refresh button in Lectora?

rvj
Community Member Posts: 27
Hello. I have lectora publisher. In lectora, there is same URL for every page in the course. So, if a user refresh the page, it will go to the first page of the course. I don't want this, So, I want to disable the refresh option in Lectora copurses. How can I do this? Also, If user wants to refresh, then I have put a refresh button in lectora itself, not in browser and by some javascript, user can refresh the same page by using button I provided in Lectora. But issue is with browser's refresh. Is there any way I can achieve this? Or any other way to prevent this issue?
Comments
-
Maybe it is too late for you, but just in case you haven't figured out a solution yet.
Disabling browser refresh:
//this code handles the F5/Ctrl+F5/Ctrl+R
document.onkeydown = checkKeycode
function checkKeycode(e) {
var keycode;
if (window.event)
keycode = window.event.keyCode;
else if (e)
keycode = e.which;
// Mozilla firefox
if ($.browser.mozilla) {
if (keycode == 116 ||(e.ctrlKey && keycode == 82)) {
if (e.preventDefault)
{
e.preventDefault();
e.stopPropagation();
}
}
}
// IE
else if ($.browser.msie) {
if (keycode == 116 || (window.event.ctrlKey && keycode == 82)) {
window.event.returnValue = false;
window.event.keyCode = 0;
window.status = "Refresh is disabled";
}
}
}
[/CODE]
[B][I]Disabling right click:[/I][/B]
[CODE]
var bodyTag = document.getElementsByTagName("body");
bodyTag[0].setAttribute("oncontextmenu","return false;");
[/CODE][CODE]
//this code handles the F5/Ctrl+F5/Ctrl+R
document.onkeydown = checkKeycode
function checkKeycode(e) {
var keycode;
if (window.event)
keycode = window.event.keyCode;
else if (e)
keycode = e.which;
// Mozilla firefox
if ($.browser.mozilla) {
if (keycode == 116 ||(e.ctrlKey && keycode == 82)) {
if (e.preventDefault)
{
e.preventDefault();
e.stopPropagation();
}
}
}
// IE
else if ($.browser.msie) {
if (keycode == 116 || (window.event.ctrlKey && keycode == 82)) {
window.event.returnValue = false;
window.event.keyCode = 0;
window.status = "Refresh is disabled";
}
}
}
[/CODE]
Disabling right click:
var bodyTag = document.getElementsByTagName("body");
bodyTag[0].setAttribute("oncontextmenu","return false;");
[/CODE][CODE]
var bodyTag = document.getElementsByTagName("body");
bodyTag[0].setAttribute("oncontextmenu","return false;");
[/CODE]
Categories
- 35.9K All Categories
- 109 ✫ Announcements
- 33.1K Lectora®
- 31.1K Lectora Discussions
- 29K Lectora Desktop
- 2K Lectora Online
- 2K Lectora Feature Requests
- 71 Lectora User Groups
- 36 Lectora Accessibility User Group (LAUG)
- 25 ELB Learning Content
- 25 ELB Learning Content Discussions
- 328 CenarioVR®
- 195 CenarioVR Discussions
- 133 CenarioVR Feature Requests
- 42 Rockstar Learning Platform®
- 39 Rockstar Learning Platform Discussions
- 108 CourseMill®
- 108 CourseMill Discussions
- 47 ReviewLink®
- 47 ReviewLink Discussions
- 7 The Training Arcade®
- 7 The Training Arcade Discussions
- 936 All Things eLearning
- 37 eLearning Development
- 546 Learning Management System (LMS) Integration
- 333 Web Accessibility
- 1.2K ♪ The Green Room
- 9 Additional Learning Products