TechplexEngineer
12/19/2011 - 5:25 AM

Is there a way to make this work?

Is there a way to make this work?

        var q = $.parseQuery();
        if(!q.plugin)//If the value isn't set
            window.location = "./"; //Go to the index file
        yepnope([{
            test: q.plugin === 'javascript',
            yep: 'plugins/javascript.js',
            nope: yepnope([{
                test: q.plugin === 'arduino',
                yep: 'plugins/arduino.js',
                nope: yepnope([{
                    test: q.plugin === 'frcjava',
                    yep: 'plugins/frcjava.js',
                    nope: function() {alert("error");} //What if none of the tests are true.
                }])
            }])
        }]);
//In theory this will run the tests and if none of them are true, then It should call the alert()