Handling object method function calls in setTimeout (javascript)?
<p>Code:</p>

<pre><code>​var a = function() {
   this.message = "hello";
    this.shout = function(){
        alert(this.message); // alerted undefined
    }
    this.Timer = setTimeout(this.shout, 3000);
}

var b = new a();
</code></pre>

<p>I get undefined in the alert dialog.  I've tried "this.shout()" in setTimeout but then there is a DOM error on finding shout.  How do I deal with this?</p>
