Convert VBScript to Javascript

Busy debugging a strange problem related to the way some Flash content transfers the user’s results from the SCORM module back to Moodle.

In IE 6, 7, 8, 9, Chrome and Firefox, everything works fine. In IE 10, tracking progress from the Flash module does not reach the server.

In the SCORM launcher, an event handler is created using the following (ancient) code:

<SCRIPT LANGUAGE="VBScript"> on error resume next sub preloader_FSCommand(ByVal command, ByVal args) call preloader_DoFSCommand(command, args) end sub </SCRIPT> 

Debugging in Chrome, I see that the function is being called as expected.

Debugging attempt in IE 10 failed because the code was never called. How to translate this code to Javascript? Trying to remove VBScript as it seems to be part of the problem. I tried the following code without success:

 <script> function preloader_FSCommand (command, args) { preloader_DoFSCommand(command, args); } </script> 

preloader_DoFSCommand defined elsewhere in the code and is called simply thin in Chrome / Firefox / etc, but not in IE 10.

Update . It seems that part of the problem is related to IE 10, which no longer supports FSCommand in standard mode. The question now becomes, what would be a suitable workaround that does not require changing the contents of Flash / SCORM?

+6
source share
2 answers

Try turning IE10 into IE9 compatibility mode with the following in <head> : <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />

+3
source

The Javascript method for implementing the same Flash connection should be as follows:

 <script type="text/javascript" event="FSCommand(command,args)" for="preloader"> preloader_DoFSCommand(command,args); </script> 
0
source

All Articles