PrepAway - Latest Free Exam Questions & Answers

You need to implement the button functionality

DRAG DROP
You are developing 3 Windows Store game. The game uses a JavaScript library named
GetGame.js.
The game interface will include two buttons. One button will start a new game and one
button will cancel the game.
You need to implement the button functionality.
Develop the solution by arranging the code segments in the correct order. You will need all
of the code segments.

PrepAway - Latest Free Exam Questions & Answers

Answer:

2 Comments on “You need to implement the button functionality

  1. Moe says:

    1) var doGame;
    document.getElementById(‘workersStartGameButton’).addEventListener(‘click’, handle_workersStartGameButton, flase);
    document.getElementById(‘workersCancelGameButton’).addEventListener(‘click’, handle_workersCancelGameButton, false);
    2) doGame.onmessage = function(e){
    if(e.data.isThisAGame){
    outputBox.innerHTML = n + ” is a game.”;
    }
    }
    3) function handle_workersStartGameButton(){
    4) doGame = new Worker(“GetGame.js”);
    5) }
    function handle_workersCancelGameButton(evt)
    {
    if (doGame){
    6) doGame.terminate();
    7) doGame = null;
    8) }
    }




    0



    0

Leave a Reply