[dev] [cvs] commit: incubator/Horde_Form/js eventlistener.js

Jan Schneider jan at horde.org
Sat Jul 30 10:58:22 PDT 2005


Zitat von Chuck Hagenbuch <chuck at horde.org>:

> Quoting Matt Warden <mwarden at gmail.com>:
>
>>  Added files:
>>    Horde_Form/js        eventlistener.js
>>  Log:
>>  Saw this kind of code all over Horde's JS files, so just wrote a
>> couple functions to make things easier. I prefer the method used in
>> initBody with an array of functions, but I can't assume that there is
>> not already an attached listener, so I had to use the 'recursive'
>> method as well
>
> Since you're being unobtrusive, don't need to generally go with the
> addObjectEventListener() method anyway? Given this, I'd encourage you
> to use the implementation in horde/js/form_helpers.js (the addEvent()
> function) instead, since it takes either a string of javascript or a
> function reference.
>
> The only reason I haven't broken this out into a seperate file is the
> lack of "require" in javascript. Ideas on dealing with that are very
> welcome. :)

You can document.write() SCRIPT tags.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the dev mailing list