SCORM标准中找API_1484_11方法(xtqgbusr)

也不知道仁兄的真名,也不知道说的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
}

标签:SCORM标准找API_1484_11方法
分类:平台开发| 发布:可木| 查看: | 发表时间:2005-11-24
如果网站内容侵犯了您的权利,请跟站长联系!www.iscorm.cn scorm标准研究与elearning研究网站
本文链接:http://www.iscorm.cn/post/148.html

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Design By Seanloo.cn| 管理 | Power By Z-Blog 1.8 Walle Build 100427.