Forum Discussion
RonLinder-4c1a3
2 months agoCommunity Member
Closing module mechanism
Is there a way to do the following: If a user closes the module at any time using the "X" of the window --> redirect to another URL. Also I have a jscript inside my storyline that stores the userID...
RonLinder-4c1a3
Community Member
I managed to do it this way which is similar to your suggestion:
// Get the value of the Storyline variable
let player = GetPlayer();
player.SetVar("Exit_Course",true);
var empID = player.GetVar("student_id");
var url = "https://xxxx.com/index.aspx?csf=1&web=1&e=eDNr93&EmployeeID=" + empID;
var win = window.open(url);
But the issue I am having is Workday does the following when someone navigates to a module:
- opens a tab in browser
- when you click to open the module it opens a popup window with the module in it
- how do I close that initial tab (in step 1) when the popup window is closed?
I tried:
var win window.top.close();
but nothing happens.
Also tried:
EXIT_BEHAVIOR = "ALWAYS_CLOSE_PARENT";
But no go as well.
SamHill
2 months agoSuper Hero
window.opener.close()
You can reference the browser window that opened the one you are in through JavaScript window.opener. it is possible it will not allow it to close though.