I asked this question before here (HTML5 reload page when moving back), but the responses and answers were getting too messy, so I started fresh. Still don't have it working. Thought I'd ask again.
I'm working with Moodle 2.6, but this isn't really a Moodle question. An activity is defined as an URL. You click on that link for a URL, and it goes to an HTML5 page that is just a custom-built video player. When the video ends, it goes back to the Moodle course page. That all works just fine, but the Moodle page doesn't reflect that this activity has been completed until the page is refreshed/reloaded using F5. Here is the javascript code that I've used to detect the end of the video:
video1.addEventListener("ended", function() {
history.back(1);
});
I've tried using a number of different variants, such as history.go(-1), etc., but nothing seems to work.
A responder to my previous question suggested using
location.href = document.referrer;
which didn't work. I hard-coded the address that I wanted to return to on the right side of that as a trial, and it seemed to work correctly. I thought that I could just pull the address out of the history buffer, but I can't find a way to access the history buffer strings directly so that I can use them.
So, is there a way to access the history buffer URL strings, or do you have a better suggestion on how to go back to the previous page AND refresh/reload this page. I can get it to go back, but it won't refresh. I'm mainly using IE on the PC, and Safari on the iPad.
Thanks, Bill