Setting members of object using function fails
<p>I'm trying to implement a kind of multiplayer extension to a game I'm creating. After a XMLHttpRequest, a game ID is returned, i.e. the ID of a multiplayer session.</p>

<p>I'm using the following code, in which Multiplayer is a static class:</p>

<pre><code>var Multiplayer = {
    baseURL: 'http://127.0.0.1:8888/m',
    gameID: -1,

    create:
    function() {
        $.get(this.baseURL, {'a':'c'}, function(text) {
            this.gameID = parseInt(text);
        });
    }
}
</code></pre>

<p>It fails, because it seems <code>this.gameID = parseInt(text)</code> cannot be used. When I change it to <code>Multiplayer.gameID = parseInt(text)</code>, it works like a charm.</p>

<p>It seems like <code>this.gameID</code> is undefined, while <code>Multiplayer.gameID</code> can both be written to and read from.</p>

<p>Is this correct and if so, why is this the case?</p>
