The "this" object in my script doesn't support this property or method in IE
<p>I have a piece of code that works in Chrome amd Firefox, but not in IE8. The idea is to check the height of the document when it is being resized, so that a fixed scrollable area is always the height of the webpage.</p>

<pre><code>24    MyJavascript.prototype.handleWindow_onResize = function (e) {
25        window.clearTimeout(this.windowResizeTimer);
26        this.windowResizeTimer = setTimeout(function () {
27            this.doStuff();
28        }.bind(this), 20);
29    };
</code></pre>

<p>In IE8, when I re-size the window, I get the error:</p>

<pre class="lang-none prettyprint-override"><code>Message: Object doesn't support this property or method
Line: 26
Char: 9
Code: 0
URI: XXX
</code></pre>

<p>Can anyone see what I am doing wrong? I guess the "this" is the problem, but I don't see why IE8 is treating it in a different way to Chrome and FF.</p>

<p>N.B. In IE7 mode of my IE8 browser, this error appears on page-load, not on resize.</p>
