Skip to content
This repository has been archived by the owner on Nov 15, 2017. It is now read-only.

Event handlers and innerHTML - together at last? #1

Closed
insin opened this issue Feb 5, 2011 · 1 comment
Closed

Event handlers and innerHTML - together at last? #1

insin opened this issue Feb 5, 2011 · 1 comment

Comments

@insin
Copy link
Owner

insin commented Feb 5, 2011

Since we're always working with objects when generating HTML with DOMBuilder, make some use of them.

How about providing a method on HTMLElement which finds children which have ids and event handling Function attributes and registers events on the elements with the appropriate ids?

Users could call this method after they've toString()ed and innerHTMLed to set up all the event listeners - switching from DOM to HTML mode without changing any element creation code would then be a viable option for people looking for a speedup.

We could generate dummy ids for HTMLElements which have event listening function attributes but no id attribute to make this totally automatic as far as the user is concerned.

Providing a function which takes the element to be innerHTMLed and does both steps would make it even nicer.

@insin
Copy link
Owner Author

insin commented Feb 8, 2011

Implemented in a080d6c

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant