Javascript Events: Getting notified of changes in an <input> control value

前端 未结 6 976
野的像风
野的像风 2020-12-11 04:09

I have the following problem:

I have an HTML textbox () whose contents are modified by a script I cannot touch (it is my page

6条回答
  •  青春惊慌失措
    2020-12-11 04:25

    Depending on how the external javascript was written, you could always re-write the relevant parts of the external script in your script and have it overwrite the external definition so that the change event is triggered.

    I've had to do that before with scripts that were out of my control.

    You just need to find the external function, copy it in its entirety as a new function with the same name, and re-write the script to do what you want it to.

    Of course if the script was written correctly using closures, you won't be able to change it too easily...

提交回复
热议问题