it looks like mscross had objRef to maintain the scope he wanted. (though he didn't need to extend Object.prototype).
in jquery when you attach an event, "this" in a callback refers to the html element that was clicked or mouseover-ed etc.
in his lib, he is saving a reference to an html element in objRef, which he uses later to set the scope. another way would be to use .apply/.call or just use jquery.

-b

On 10/9/06, Klaus Hartl <[EMAIL PROTECTED]> wrote:


Stephen Woodbridge schrieb:
> Michael and Brent,
>
> Thank you very much! That was it.
>
> Any idea why that would have been done in the first place?
>
> I ran into another issue that all my for loops in code I added to
> mscross were returning a null objRef at the end of the loop and I had to
> add code to detect that and break out of the loop. This is all a little
> new to me and I'm still learning.

Stephen, as I wrote in the other post, to avoid these problems, you
should use these loops like this:


for (propName in obj) {
      if (obj.hasOwnProperty(propName)) {
          // do something with property...
      }
}


-- Klaus

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to