can't find the LMS API in frames

Hi all-

I am working on a course that has to be output to html5 only. I am using some javascript calls to set some variables (userName and dateCompletedString) which I url encode and pass to a certificate of completion.

A simplified version of my code:

var d = new Date();
var dateCompletedString = (d.getMonth()+1) + "/" + d.getDate() + "/" + d.getFullYear() ;
var lmsAPI = parent;
var userName = lmsAPI.GetStudentName();
window.open('certificate.html?userName='+userName+'&dateCompletedString='+dateCompletedString);

Under normal circumstances it works great. However, there are multiple language versions of this course that now need to be consolidated into one package. The client has asked that the language be selected up front using a frame setup where the language selection page is replaced by the appropriate content (individual storyline files for each lang).

I have that set up, and the normal communication (bookmarking, completion, etc.) is working. However the javascript no longer does. It appears to be breaking down when the GetStudentName() is called, as if it isn't finding the API.

Anyone have suggestions or successfully dealt with something similar?

Thanks in advance!

Dave

2 Replies
Christoph Krieger

JavaScript and HTML5 seem not to be good friends at the moment.

Here is an similar discussion and it seems to be a bug. Also having problems with that as I want to switch all my courses to HTML5 and many of them are using JS.

I hope this gets fixed within the next few days.

https://community.articulate.com/discussions/articulate-storyline/storyline-360-javascript-interaction

 

David Oskorus

Thanks Chistoph. I didn't even realize you could do some of those things Sopharo noted.

I have managed to get it working if I have the language selection button open the course in a new window rather than replacing the frame in the frame set. That is less than ideal, but I'm afraid I will have to do that for now.