Javascript event handler order

后端 未结 4 1428
我在风中等你
我在风中等你 2020-12-03 14:37

I have an input field, which has two event handlers bound to it.

Validate & AutoSave

Obviously I want to validate before I save. If validation fails, the

4条回答
  •  没有蜡笔的小新
    2020-12-03 15:04

    Why not attach just one handler -- Validate -- and call AutoSave from inside it?

    For an answer to your question that isn't also a question, see this post or this one or this one.

提交回复
热议问题