Mozilla FF SCORM problem
December 13, 2007 12:00 AM
Ludo,Below is the fix. I already copied it into the wrapper (replacing the findAPI and getAPI functions) and everything seems to works fine. Someone else could've figured it out quicker but it was a good learning experience.Jerry /*********************************************************** ************************ Function findAPI(win)** Inputs: win - a Window Object** Return: If an API object is found, it's returned, otherwise null is returned**** Description:** This function looks for an object named API in parent and opener windows** ************************************************************ *******************/function findAPI(win){ // Search the window hierarchy for an object named "API" // Look in the current window (win) and recursively look in any child frames // =================== // ORIGINAL ADL METHOD // This section of code replaced by a more robust version below. (SATERN - W. Rydbom) // if (win.API != null) // { // return win.API; // } // =================== //
// SATERN FIX // Determine which browser this is so that we can properly find the API. // ADL's scripts were geared towards IE only. (SATERN - W. Rydbom) var svUserAgent = navigator.userAgent.toLowerCase(); this.isOpera = (svUserAgent.indexOf('opera') != -1); this.isIE undefined = (svUserAgent.indexOf('msie') != -1 && !this.isOpera && (svUserAgent.indexOf('webtv') == -1) ); // If this is IE, use the original ADL fuction's method. (SATERN - W. Rydbom) if ( this.isIE ) { if (win.API != null) { if (_Debug) { alert("IE Browser: Found API in this Window"); } return win.API; } // Mozilla and Safari have trouble finding the API using the method used originally. // This method should allow the API to be found in browsers that are 'not compatible' // with ADL's generic scripts. (SATERN - W. Rydbom) } else { if (win.document.API != null) { if (_Debug) { alert("Non-IE Browser: Found API in this Window"); } return win.document.API; } } //
if (win.length > 0) // does the window have frames? { for (var i=0;i
// SATERN FIX // Fix for finding the parent window, otherwise routine won't properly search // all the available framesets. (SATERN - W. Rydbom) if (typeof(this.top.opener) != "undefined") //
{ // =================== // ORIGINAL ADL METHOD // if (this.opener != null) // =================== //
// SATERN FIX // Fix for finding the parent window, otherwise routine won't properly search // all the available framesets. (SATERN - W. Rydbom) if (this.top.opener != null) //
{ // =================== // ORIGINAL ADL METHOD // theAPI = findAPI(this.opener.top); // =================== //
// SATERN FIX // Fix for finding the parent window, otherwise routine won't properly search // all the available framesets. (SATERN - W. Rydbom) theAPI = findAPI(this.top.opener.top); //
} } } return theAPI;}
Discussions have been disabled for this post