开发者

Recursive issues

开发者 https://www.devze.com 2023-02-13 15:42 出处:网络
When I have two text fields which listen to change event from one to another, it causes me an error saying too much recursion.开发者_JAVA技巧 Anyone has good solution?well you can hold a flag that hol

When I have two text fields which listen to change event from one to another, it causes me an error saying too much recursion.开发者_JAVA技巧 Anyone has good solution?


well you can hold a flag that holds the identity of the true event dispatcher. and break the event triggering if it matches.


You added an onchange event listener on both text fields; problem is, changing one text will trigger a change one the other field, which would trigger the onchange result for the first one, etc., resulting in an infinite loop.

0

精彩评论

暂无评论...
验证码 换一张
取 消