tag:blogger.com,1999:blog-32241238.post405055462417971053..comments2023-03-25T05:46:26.256-04:00Comments on Why not?: Aspect Oriented Programming in JavascriptDanhttp://www.blogger.com/profile/06099373265709774874noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-32241238.post-20349021146331606472013-01-03T13:59:57.519-05:002013-01-03T13:59:57.519-05:00Wow, it's been so long since I wrote this that...Wow, it's been so long since I wrote this that I had to reread my own post. To answer your question, yes, probably. Event delegation would almost certainly handle this case, though it's a technique that I was unaware of back in 2008. (I don't think delegation was as popular then as it is now.)<br /><br />Of course, this would only work if YUI adds sufficient metadata to the elements that it generates. After all, by using delegation, all the nodes share a single callback and we need to be able to derive whatever information we need from the DOM nodes themselves.<br /><br />There may be other specifics that I'm forgetting, but I think delegation is a completely reasonable solution. On the other hand, I'm sure that YUI is a completely different beast today. It's possible that there are better solutions to the problem now.Danhttps://www.blogger.com/profile/06099373265709774874noreply@blogger.comtag:blogger.com,1999:blog-32241238.post-49577539037270338132013-01-03T12:06:21.043-05:002013-01-03T12:06:21.043-05:00Thanks for the article. On a side note, would it b...Thanks for the article. On a side note, would it be possible to solve your YUI problem with event delegation, thereby avoiding the need to re-attach event listeners after re-rendering of HTML elements? oatkillerhttps://www.blogger.com/profile/12585121063616371879noreply@blogger.comtag:blogger.com,1999:blog-32241238.post-32526813851792016082008-06-04T22:13:00.000-04:002008-06-04T22:13:00.000-04:00That's pretty awesome! I don't know that I'd call...That's pretty awesome! I don't know that I'd call it AOP, but then again, AOP seems like pure evil to me, whereas this seems reasonable in a prototype based language like javascript.Anonymousnoreply@blogger.com