[Javascript] weird FX event model

Troy III Ajnej trojani2000 at hotmail.com
Sat May 3 22:50:11 CDT 2008


I don't think so!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                        Troy III                            progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Date: Sat, 3 May 2008 23:22:40 -0400From: rer at datacompusa.comTo: javascript at lists.evolt.orgSubject: Re: [Javascript] weird FX event model
Troy,Troy III Ajnej wrote: 


I have e function like this: function onmouseover(e){-------------8<---------------- As it turns out I understand that it is not the statement:document.onmouseover = onmouseoverthat causes the problem, but the name of the function itself.  This means that you can use a never seen before syntax: function onclick(){alert ("I must have clicked somewhere")} And it will work!!! After discovering this weird hybrid (event-function) object, I've managed to eliminate the double function call by changing the name of the function, naturally, but what do you call it? Is it some sort of a proprietary shorthand scripting routine I never seen before, or what?I could be wrong, but my understanding is that everything in Javascript is associated with an object.  In a browser environment, window is the top-level object, so all functions and variables that appear to be top-level items actually are properties and methods of the window object.  If that is true, thenfunction onmouseover(e) {}  is the same aswindow.onmouseover = function(e) {} So, the behavior you are seeing is the behavior I would have expected.hthRoger-- 
Roger Roelofs
Datacomp Appraisal Services
3215 Eaglecrest, NE            E: rer at datacompusa.com
Grand Rapids, MI  49525        W: http://www.datacompusa.com

_________________________________________________________________
Make Windows Vista more reliable and secure with Windows Vista Service Pack 1.
http://www.windowsvista.com/SP1?WT.mc_id=hotmailvistasp1banner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20080504/46a03ddb/attachment.htm>


More information about the Javascript mailing list