0

I have a TEXTAREA that is created through an external JavaScript. I am writing new script to detect when the contents are changed. DOM events like "change" and "blur" do not work, since the change is initiated by the other script. I do not have the ability to read/modify the external script.

Any ideas?

1
  • you have to use kind of observable Commented Jun 6, 2013 at 17:07

1 Answer 1

1

If you want full cross-browser support, you will simply have to set up a polling interval and compare the contents each time to what you saw the last time. DOM mutation events aren't going to cut it.

Have fun.

Sign up to request clarification or add additional context in comments.

6 Comments

And DOM mutation events are already deprecated before even had been implemented in all major browsers
That, too! I heard they were not to be relied on.
An other way could be to extend some jquery method(s) if the external plugin use it to update textarea value. For example, OP could look here even there it is for DOM change: stackoverflow.com/a/15973530/1414562
Just FYI, DOM4 mutation observers are the replacement for deprecated DOM3 mutation events, but they're not widely supported, so your advice is necessary for cross-browser support.
@roasted That's a big if. Yes, if the other script uses jQuery then perhaps you could tweak jQuery to let you know when the value is changed.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.