On Sep 3, 12:07 am, Hipnotik <[email protected]> wrote:
> Hi
> How to call some action if content of the div element has changed?
>
> I'm talking about something like this:
> $("my-div").observe("change", function(e) {
>     alert("hello");
>
> });
>
> Expecting behavior:
> I have this
> <div id="my-div">some text</div>
>
> now I'm changing "some text" to "some other text" and "alert("hello")"
> should be fired.

There is no change event specified for div elements, what you are
looking for is provided by DOM mutation events:

<URL: http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MutationEvent
>

OK in Firefox, Opera, Safari and a few others, but not IE.

Some help here:

<URL: http://www.howtocreate.co.uk/tutorials/javascript/domevents >

The best cross-browser strategy is to get the function that modifies
the DOM to call the function you'd like to add as a DOMSubtreeModified
listener.


--
Rob
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to