Storyline 360

Why does this javascript for pulling the name from the LMS work on every browswer except for Safari and FireFox? 

var player = GetPlayer();

var myName = lmsAPI.GetStudentName();

var array = myName.split(',');
var newName = array[1] + ' ' + array[0];

player.SetVar("newName", newName);

//myName = player.GetVar('myName');

//player.SetVar("newName", newName);

 

1 Reply
Zsolt Olah

Hi Catherine,

My assumption is that Firefox and Safari is launching the HTML5 version of the course, while Chrome and IE is using the Flash version. That's why it's not working in Firefox and Safari. The lmsAPI is not defined in html5.

Try this: add the lmsAPI=parent; line before you use the lmsAPI.GetStudentName() function, so it looks like this:

var player = GetPlayer();

lmsAPI=parent;

var myName = lmsAPI.GetStudentName();

Not tested though!! :)