[Javascript] Problem w/Javascript, interpolation, functions, onclick

Paul Novitski paul at juniperwebcraft.com
Wed Oct 25 12:57:18 CDT 2006


At 10/25/2006 10:44 AM, Matt Warden wrote:
>On 10/25/06, Paul Novitski <paul at juniperwebcraft.com> wrote:
>>                  // now act on the object whose behavior triggered
>>this function
>>                  var sClass = this.tagName;       // etc.
>
>This is incorrect. In IE, events are executed in the window scope, so
>when you do this.tagName, it is equivalent to doing window.tagName.
>You must get the target element from the event itself


Interesting!  I wonder what's causing my scripts to work properly in IE.

Do you mean IE 5.5 and earlier?  I've been doing all my scripting 
tests in IE 6 for a long time, and it seems to handle this scope 
issue the same as Firefox/Mozilla.

Regards,
Paul




More information about the Javascript mailing list