Home » Programming in Javascript » JavaScript Workshop 4 (TEAM SKYWALKER)

JavaScript Workshop 4 (TEAM SKYWALKER)

The fourth workshop for the Javascript unit is now available. YOU SHOULD ONLY DO THIS WORKSHOP IF YOU ARE IN TEAM SKYWALKER. NO CREDIT WILL BE GIVEN IF YOU ARE IN TEAM SOLO – although if you want to do some extra work, fill your boots! Just make sure you’ve done your own work first!

Follow this link to log in and do the workshop.


1 Comment

  1. Again me!!! I’m trying to do the silver option, as it says on button two function, i am using an IF function and a variable. It works great but it is not correct to achieve the silver and I want to know what I’m missing here. Thanks

    var action = 1;

    function open()
    {
    document.getElementById(“jackbox”).src = “http://fetlar.kingston.ac.uk/pp/jackbox-open.jpg”;
    }

    function close()
    {
    document.getElementById(“jackbox”).src = “http://fetlar.kingston.ac.uk/pp/jackbox-closed.jpg”
    }

    function change()
    {
    if ( action == 1 ) {
    open();
    action = 2;
    } else {
    close();
    action = 1;
    }
    }

    document.getElementById(“toggle”).onclick = change;

Leave a Reply to lucas de haro pishoudt Cancel reply

Your email address will not be published. Required fields are marked *