最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Convert VBScript to Javascript - Stack Overflow

programmeradmin0浏览0评论

Busy debugging a strange issue relating to the way some Flash content municates a user's progress from a SCORM module back to Moodle.

On IE 6, 7, 8, 9, Chrome and Firefox, everything works fine. On IE 10, progress tracking from the Flash module is not reaching 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 mand, ByVal args)
  call preloader_DoFSCommand(mand, args)
end sub
</SCRIPT>

Debugging on Chrome, I can see that the function is called as expected.

Attempting to debug in IE 10 fails, as the code is never called. How would I translate this code to Javascript? Trying to remove the VBScript as it appears to be part of the problem. I tried the following code, without success:

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

preloader_DoFSCommand is defined elsewhere in code, and is called just fine on Chrome/Firefox/etc, but not on IE 10.

Update: Seems that part of the problem is related to IE 10 no longer supporting FSCommand in standards mode. Question now bees, what would be a suitable workaround, which does not require the Flash/SCORM content to change?

Busy debugging a strange issue relating to the way some Flash content municates a user's progress from a SCORM module back to Moodle.

On IE 6, 7, 8, 9, Chrome and Firefox, everything works fine. On IE 10, progress tracking from the Flash module is not reaching 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 mand, ByVal args)
  call preloader_DoFSCommand(mand, args)
end sub
</SCRIPT>

Debugging on Chrome, I can see that the function is called as expected.

Attempting to debug in IE 10 fails, as the code is never called. How would I translate this code to Javascript? Trying to remove the VBScript as it appears to be part of the problem. I tried the following code, without success:

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

preloader_DoFSCommand is defined elsewhere in code, and is called just fine on Chrome/Firefox/etc, but not on IE 10.

Update: Seems that part of the problem is related to IE 10 no longer supporting FSCommand in standards mode. Question now bees, what would be a suitable workaround, which does not require the Flash/SCORM content to change?

Share Improve this question edited Mar 14, 2013 at 1:54 Ryan asked Mar 14, 2013 at 0:41 RyanRyan 28.2k10 gold badges58 silver badges83 bronze badges 2
  • Try to force IE10 into IE9 patibility mode with the following in your '<head>': <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" /> – Jacob VanScoy Commented Mar 14, 2013 at 3:05
  • That solves it - thanks! Feel free to move it to answer and I'll mark it as accepted. – Ryan Commented Mar 14, 2013 at 15:02
Add a ment  | 

2 Answers 2

Reset to default 3

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

A Javascript way of effecting the same munication with Flash would be to use the following:

<script type="text/javascript" event="FSCommand(mand,args)" for="preloader">
    preloader_DoFSCommand(mand,args);
</script>
发布评论

评论列表(0)

  1. 暂无评论