G
GinnTech
I have a site that works perfectly in IE6 IE7 FF2 FF3 but not in the
latest Safari.
Here is the issue. I am attempting to call functions within a flash
object. When trying to attempt to retrieve the object to call the
functions IE6 IE7 FF2 FF3 all return Objects to work with. In Safari
a function is returned. Here is the code.
The code errors at
api.setActivityID( document.forms[0].activityID.value );
with
Value undefined(result of expression api.setActivityID) is not
object.
Low and behold it's not an object it's a function in the eyes of
safari.
Does anyone know a work around for this in safari.
Thank you,
Tim
latest Safari.
Here is the issue. I am attempting to call functions within a flash
object. When trying to attempt to retrieve the object to call the
functions IE6 IE7 FF2 FF3 all return Objects to work with. In Safari
a function is returned. Here is the code.
Code:
/
*******************************************************************************
**
** Advanced Distributed Learning Co-Laboratory (ADL Co-Lab) grants
you
** ("Licensee") a non-exclusive, royalty free, license to use, modify
and
** redistribute this software in source and binary code form, provided
that
** i) this copyright notice and license appear on all copies of the
software;
** and ii) Licensee does not utilize the software in a manner which
is
** disparaging to ADL Co-Lab.
**
** This software is provided "AS IS," without a warranty of any kind.
ALL
** EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
INCLUDING
** ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE
** OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. ADL Co-Lab AND ITS
LICENSORS
** SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
RESULT OF
** USING, MODIFYING OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES.
IN NO
** EVENT WILL ADL Co-Lab OR ITS LICENSORS BE LIABLE FOR ANY LOST
REVENUE,
** PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
** INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF
THE
** THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE
** SOFTWARE, EVEN IF ADL Co-Lab HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH
** DAMAGES.
**
*******************************************************************************/
/
*******************************************************************************
** This file is part of the ADL Sample API Implementation intended to
provide
** an elementary example of the concepts presented in the ADL Sharable
** Content Object Reference Model (SCORM).
**
** The file is used by the run time environment to maintain internal
communication
** within the frames of the environment.
**
*******************************************************************************/
var _Debug = true; // set this to false to turn debugging off
// and get rid of those annoying alert boxes.
// local variable definitions
var apiHandle = null;
var API = null;
var findAPITries = 0;
/
*******************************************************************************
**
** Function: doInit()
** Inputs: none
** Return: false if the API handle cannot be located
**
** Description: gets the API handle and sets up necessary api variable
values
**
**
*******************************************************************************/
function initAPI()
{
var api = getAPIHandle();
if (api == null)
{
alert("Unable to locate the RTE's API Implementation");
return "false";
}
else
{
api.setActivityID( document.forms[0].activityID.value );
api.setCourseID( document.forms[0].courseID.value );
api.setStateID( document.forms[0].stateID.value );
api.setUserID( document.forms[0].userID.value );
api.setUserName( document.forms[0].userName.value );
api.setNumAttempts( document.forms[0].numAttempts.value );
api.clearState();
}
}
/
******************************************************************************
**
** 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++;
// Note: 500 is a number based on the IEEE API Standards.
if ( findAPITries > 500 )
{
alert("Error finding API -- too deeply nested.");
return null;
}
win = win.parent;
}
//ToDo:Start Here Debugging how to get Safari to see this object.
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("RTE - Can not locate API adapter");
}
return theAPI
}
The code errors at
api.setActivityID( document.forms[0].activityID.value );
with
Value undefined(result of expression api.setActivityID) is not
object.
Low and behold it's not an object it's a function in the eyes of
safari.
Does anyone know a work around for this in safari.
Thank you,
Tim