Subj : Re: associating an object with a Function object To : netscape.public.mozilla.jseng From : Brian Genisio Date : Fri Mar 05 2004 03:32 pm Brendan Eich wrote: > Brendan Eich wrote: > >> Brian Genisio wrote: >> >>> Hi all, >>> >>> In IE's JS engine, I can write the following: >>> >>> >>> >>> >>> It will execute the click() as if it were associated with the >>> myButton object. >> >> > > Is this something you really want to emulate? It's not standard. > Mozilla doesn't do it. I doubt Opera and Safari do it (someone check). > Worth a note to the mozilla.dom group seeking advice on how widespread > the use of this IE-ism might be? > > /be Yes, and No. Do I really want to emulate this? No. Do I have to? Yes :) I have mentioned this in the past, but I am writing a tool that emulates a browser to the best it can. Our users mostly develop for IE, and then it goes to their QA department, where they use my tool, and do not have control over the code. If my tool does not act the way they expect it to (ie. IE), it is not useful to them. Eventually, this tool will emulate a Mozilla browser in addition to IE, which will be worlds easier for me. Quite frankly, I am getting annoyed with the way IE changes behaviors of things, and promotes poor coding mechanisms. For that matter, I have been annoyed with it for years, but only now can I really appreciate the annoyance :) The function object storing mechanism used is used on the CNN web page. A poster in comp.lang.javascript claims that it is a speed enhancement... though I cannot immagine it is worth the portability loss. Thanks (again) for your help, Brian .