Hello,
I'm trying to build a simple API - it's running fine in Safari and Firefox but failing in IE and Opera. In order to isolate the problem I've stripped it right back 'til all the methods are just alerting their own name. Safari and Firefox give me loads of alerts, but in Opera and IE I just get one, LMSInitialize() when the page first loads - at least I know the browser is finding the API properly.
IE also runs LMSCommit() and LMSFinish() when you close the browser window; that's good, but not enough. Opera doesn't even do that. The trigger for all this is a Flash movie created in Adobe Captivate, and published with a whole lot of its own JS which I can't touch - it's running in an iframe, and it's the parent window which includes the API. I need to work out whether there's an issue in my code, or if it's to do with the movie or the publication settings - that side of things is out of my control.
Here's the full code of my test version of the API. I'd really appreciate any comments!
Thanks,
Ben
Code:
function SIScormAPI(){
this.version = '1.2';
this.LMSInitialize = LMSInitialize;
this.LMSFinish = LMSFinish;
this.LMSGetValue = LMSGetValue;
this.LMSSetValue = LMSSetValue;
this.LMSCommit = LMSCommit;
this.LMSGetLastError = LMSGetLastError;
this.LMSGetErrorString = LMSGetErrorString;
this.LMSGetDiagnostic = LMSGetDiagnostic;
}
function LMSInitialize(){
var alertStr1 = 'LMSInitialize() - v.'+this.version;
alert(alertStr1);
}
function LMSFinish(){
var alertStr2 = 'LMSFinish()';
alert(alertStr2);
}
function LMSGetValue(){
var alertStr3 = 'LMSGetValue()';
alert(alertStr3);
}
function LMSSetValue(){
var alertStr4 = 'LMSSetValue()';
alert(alertStr4);
}
function LMSCommit(){
var alertStr5 = 'LMSCommit()!!!!!';
alert(alertStr5);
}
function LMSGetLastError(){
var alertStr6 = 'LMSGetLastError()';
alert(alertStr6);
}
function LMSGetErrorString(){
var alertStr7 = 'LMSGetErrorString()';
alert(alertStr7);
}
function LMSGetDiagnostic(){
var alertStr8 = 'LMSGetDiagnostic()';
alert(alertStr8);
}
API = new SIScormAPI();