Why is a property undefined when it has been defined in a function?
<p>I have a page with multiple buttons, each tied to the load function that are intended to open a new window and then set it customized to which button you click after the page has loaded.
I have been storing the options in objects, with the one in use under in <code>currentTile</code>. However, once the page loads, the text that appears says <code>undefined</code>, but haven't I already defined the <code>currentTile</code> in <code>load()</code>?</p>

<pre><code>function tile(question, answer, points) {
    this.question = question;
    this.answer = answer;
    this.points = points;
}

var currentTile = {};

var testTile = new tile("How are you?", "Fine", 200);

function load(tile) {
    currentTile = tile;
    window.open("question.html", "_self");
}

function setText() {
    document.getElementById("qSlot").innerHTML = currentTile.question;
    document.getElementById("value").innerHTML = "" + currentTile.points + "";
}
</code></pre>

<p><code>load()</code> is being called like this in the html: 
    <code>&lt;td onclick="load(testTile)"&gt;&lt;/td&gt;</code></p>

<p>Thanks in advance.</p>