2

I have created a project in Articulate Storyline 3. The output of the project is basically a web page with lots of javascript. One is able to place custom javascript code inside the project. My custom code causes the browser to enter full screen mode when a button on the page is pressed. This works well in Chrome and Firefox, and even goes full screen in IE11. However, when one presses the Next button on the page to go to the next slide in the project, IE11 generates a javascript error. The error is SCRIPT16389: Incorrect function. This error seems to be a generic IE javascript error and I'm unsure how to troubleshoot this further. The custom javacript code I entered does not seem to be the immediate cause of the error, but the error is generated when the Next button is pressed. Below is the custom code I have attached to the button, that causes the browser to go full screen.

function add_script(scriptURL,oID) {
     var scriptEl = document.createElement("script");
     var head=document.getElementsByTagName('head')[0];
      scriptEl.type = "text/javascript";      
      scriptEl.src = scriptURL;      
      scriptEl.id=oID;      
      head.appendChild(scriptEl);}

//only want to add these once!
if(document.getElementById('jquery')==null){
add_script("https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js","jquery");

}


/* Get into full screen */
function GoInFullscreen(preso) {
    if(preso.requestFullscreen)
        preso.requestFullscreen();
    else if(preso.mozRequestFullScreen)
        preso.mozRequestFullScreen();
    else if(preso.webkitRequestFullscreen)
        preso.webkitRequestFullscreen();
    else if(preso.msRequestFullscreen)
        preso.msRequestFullscreen();
}

/* Get out of full screen */
function GoOutFullscreen() {
    if(document.exitFullscreen)
        document.exitFullscreen();
    else if(document.mozCancelFullScreen)
        document.mozCancelFullScreen();
    else if(document.webkitExitFullscreen)
        document.webkitExitFullscreen();
    else if(document.msExitFullscreen)
        document.msExitFullscreen();
}

/* Is currently in full screen or not */
function IsFullScreenCurrently() {
    var full_screen_preso = document.fullscreenpreso || document.webkitFullscreenpreso || document.mozFullScreenpreso || document.msFullscreenpreso || null;

    // If no preso is in full-screen
    if(full_screen_preso === null)
        return false;
    else
        return true;
}

GoInFullscreen($("#preso").get(0));

The issue can be seen by opening this link in IE11, http://andersonelearning.com/demo/FullScreen%201.1%20-%20Storyline%20output/story.html . Press the blue Enter Full Screen button. IE11 should go into full screen mode. Then press the Next button at the lower right side of the screen. The expected behavior is that the text slide 2 should appear on the screen, but instead the above error is thrown.

  • The app seems to handle going to full screen fine, so can you share the code that fires when the Next button is pressed? Since the error shows up when the Next button is pressed, I don't think the code for Enter Full Screen is responsible for the issue from what you've said and from my own tinkering with it. – Michael Apr 04 '19 at 17:45
  • Thank you for looking into this. The code for the Next button is auto-generator by the authoring tool, Articulate Storyline, and is not shown to the end user. Storyline appears to use some type of framework called React to generate its page code, which makes it difficult to decypher when looking through the source code. – michaelanderson Apr 04 '19 at 18:42
  • I don't see the cause, but the error occurs when the app tries to leave the focus from the "Next" button (at `document.activeElement.blur()`, where `activeElement` is the "Next" – rplantiko Apr 04 '19 at 20:37
  • Yes, the error occurs only when the page is placed in full screen by the code I posted, and the Next button is pressed. It's just odd that this same page performs fine in other browsers, and the error in IE doesn't really explain the problem. – michaelanderson Apr 05 '19 at 17:15

0 Answers0