Close player and redirect parent window

Jun 17, 2011

I've been trying to make the last slide in my presenter have 2 buttons which take the user to 2 different places in the course. The lesson is in a new window.

I've tried this code using the javascript opener property to redirect the parent window, but keep getting 'opener is null' error. It seems the  page that the presenter player launches from doesn't have an opener property, even though it is opened with javascript and seems like it should have the property.

I put this in the head of the webpage that opens in the last slide of the lesson
function redirect(linkid)
{
opener.location.href=linkid
window.close()
}


in the body I have the button link:
<a href="javascript:redirect('http://www.mysite.com/course/nextlessonorwhatever'')">Click Here for the next lesson</a>

This code gives the 'opener is null' like it can't find the window that opened the lesson. I'm using moodle 1.9.5 and it uses javascript to open the lesson in a new window. the only thing I can think of is that the iframes in the presenter player are hiding the window properties because they're inside each other as iframes?

help!

Or perhaps there's an easier way to close the Scorm window and redirect the parent window?

1 Reply
Justin Wilcox

Hi Saffir and welcome to Heroes! You can add an Exit tab to your presentation by customizing your player template in Player Templates -> Layout -> Toolbar Menu:

http://www.articulate.com/support/presenter09/?p=29

You could also close the browser window as the finish action of a quiz. You can also just simply close the browser window by clicking the X in the browser window.

This discussion is closed. You can start a new discussion or contact Articulate Support.