Why doesn't the function recognize the member when using "this"
<p>I have a class called imageResizing. It has a member, <code>MAX_WIDTH_ORIGINAL_IMG</code> which is defined as 650:  </p>

<pre><code>MAX_WIDTH_ORIGINAL_IMG:650,
</code></pre>

<p>and a function called <code>setMaxSizeOriginalImg</code>, and the only thing it does is alert the member  <code>MAX_WIDTH_ORIGINAL_IMG</code>: </p>

<pre><code>alert(this.MAX_WIDTH_ORIGINAL_IMG);
</code></pre>

<p>I call the function on load as follows:</p>

<pre><code> addEventSimple(window,'load',imageResizing.setMaxSizeOriginalImg);
</code></pre>

<p>And the alert box says <code>undefined</code>.</p>

<p>However, when I change the alert to <code>alert(imageResizing.MAX_WIDTH_ORIGINAL_IMG);</code>, the alert box shows 650.</p>

<p>Here is the whole code of my HTML page:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;&lt;/head&gt;
    &lt;body&gt;
        &lt;script&gt;
        if (typeof(addEventSimple)=='undefined') {
                                addEventSimple = function(obj,evt,fn) {
                                    if (obj.addEventListener)
                                        obj.addEventListener(evt,fn,false);
                                    else if (obj.attachEvent)
                                        obj.attachEvent('on'+evt,fn);
                                }
                    }   


         var imageResizing={

                MAX_WIDTH_ORIGINAL_IMG:650,

                setMaxSizeOriginalImg:function()
                {
                    alert(imageResizing.MAX_WIDTH_ORIGINAL_IMG);

                }
            };


            addEventSimple(window,'load',imageResizing.setMaxSizeOriginalImg);
    &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I would like to understand what the difference is between using <code>this</code> and the actual classname, when <em>the function is in the class itself</em></p>
