building a js api, having browser problems
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!
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;
var alertStr1 = 'LMSInitialize() - v.'+this.version;
var alertStr2 = 'LMSFinish()';
var alertStr3 = 'LMSGetValue()';
var alertStr4 = 'LMSSetValue()';
var alertStr5 = 'LMSCommit()!!!!!';
var alertStr6 = 'LMSGetLastError()';
var alertStr7 = 'LMSGetErrorString()';
var alertStr8 = 'LMSGetDiagnostic()';
API = new SIScormAPI();