也不知道仁兄的真名,也不知道说的scorm群是不是我建立的,先将他的杰作拿出来大家共享,希望能有进一步的说明或者实例,还有就是能多提供点大家感兴趣的,又是大家的难点问题的说明,谢谢! 仁兄的blog地址http://blog.hexun.com/xtqgbusr/1291716/viewarticle.html ============================================ /****************************************************************************** ** ** Function getAPIHandle() ** Inputs: None ** Return: value contained by APIHandle ** ** Description: ** Returns the handle to API object if it was previously set, ** otherwise it returns null ** *******************************************************************************/ function getAPIHandle() { if (apiHandle == null) { apiHandle = getAPI(); }
return apiHandle; }
/******************************************************************************* ** ** 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) { while ((win.API_1484_11 == null) && (win.parent != null) && (win.parent != win)) { findAPITries++;
if (findAPITries > 500) { alert("Error finding API -- too deeply nested."); return null; }
win = win.parent;
} return win.API_1484_11; }
/******************************************************************************* ** ** Function getAPI() ** Inputs: none ** Return: If an API object is found, it's returned, otherwise null is returned ** ** Description: ** This function looks for an object named API, first in the current window's ** frame hierarchy and then, if necessary, in the current window's opener window ** hierarchy (if there is an opener window). ** *******************************************************************************/ function getAPI() { var theAPI = findAPI(window); if ((theAPI == null) && (window.opener != null) && (typeof(window.opener) != "undefined")) { theAPI = findAPI(window.opener); } if (theAPI == null) { alert("Unable to find an API adapter"); } return theAPI }