Hello there,

I have another question that I hope someone can give me some insight
As I want all javascript code to be in a seperate file, I wrote a
function "initialiseElements" which literally takes an element and
initialises its behaviour based upon some attributes (classname for

Basically it takes the elemen, checks whether el.readAttribute
("isInitialised") == false, and in that case processes the element
(adding tooltips for action images, adding onclick behaviour,
onmouseover behaviour, add validators to inputs and so on...)
When processed we set el.writeAttribute("isInitialised") = true so
that it will only process one element a single time...

I found this way of working to be going great, and I basically call
the initialiseElement method for each element upon loading the form,
making it a very generic process...

However (yes, there is a but!!!), I do have an issue of course when I
cal some ajax to update the content; in that case I need to initialise
the elements that have been added...

Is there a way to observe the dom and automatically run newly created
elements through the initialise function?

Would this be a good approach?
How do you guys deal with stuff like this?

thanks so much in advance again for your much appreciated feedback.


You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to