Hello All, I am trying to watch a div, and fire an event whenever the div''s innerHTML has changed. Anyone know the event name for this? ''DOMSubtreeModified'' and ''onafterupdate''. Not really sure where to start here. Can I even do this: $(''my_element'').observe(''divUpdatedEvent'', myHandler); ? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
smellis a écrit :> Hello All, > > I am trying to watch a div, and fire an event whenever the div''s > innerHTML has changed. Anyone know the event name for this? > ''DOMSubtreeModified'' and ''onafterupdate''. Not really sure where to > start here. Can I even do this:There are DOM mutation events [1], but they''re not supported across all major browsers. What you''re looking for is probably DOMSubtreeModified. It''s not supported that well though. Test with [2]. Prototype 1.6, to be released within this century :-), should provide support for custom events, which definitely will include update events for DOM elements. Until then... [1] http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-mutationevents [2] http://www.gtalbot.org/DHTMLSection/DOM2MutationEvents.html -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks for the reply. I tried what you suggested (DOMSubtreeModified) but no luck. I started a periodical executer that checks for changes, seems to work pretty well. On Apr 17, 4:28 pm, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> smellis a écrit : > > > Hello All, > > > I am trying to watch a div, and fire an event whenever the div''s > > innerHTML has changed. Anyone know the event name for this? > > ''DOMSubtreeModified'' and ''onafterupdate''. Not really sure where to > > start here. Can I even do this: > > There are DOM mutation events [1], but they''re not supported across all > major browsers. What you''re looking for is probably DOMSubtreeModified. > It''s not supported that well though. Test with [2]. > > Prototype 1.6, to be released within this century :-), should provide > support for custom events, which definitely will include update events > for DOM elements. Until then... > > [1]http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroup... > [2]http://www.gtalbot.org/DHTMLSection/DOM2MutationEvents.html > > -- > Christophe Porteneuve a.k.a. TDD > "[They] did not know it was impossible, so they did it." --Mark Twain > Email: t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---