Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Plugin not working

monyarm

Villager
Xy$
0.00
JavaScript:
// Script

function endsWith(suffix) {
    return this.indexOf(suffix, this.length - suffix.length) !== -1;
}

function evalScript(url) {
    var xhr = new XMLHttpRequest();
    if (url.endsWith(".gz")) {
        xhr.setRequestHeader("Content-Encoding", "deflate");
    } else {}
    xhr.open('GET', url);
    xhr.onload = function() {
        if (xhr.status < 400) {
            console.log(xhr.responseText);
        }
    };
    xhr.send(null);
    var script = xhr.responseText;
    console.log(script);
    eval(script);
}
What its supposed to do is evaluate the js file its given (eval() is what the "Script" event command uses) but instead nothing happens. I also checked the console and there arent any errors
 
Top