开发者

How to avoid repeated hashchange events with jquery bbq and dependent controls?

Say I've got three select boxes all of which are set up to $.bbq.pushState onChange. If the selects also have interdependencies (e.g. selecting a different model changes what colors are available) changing one select can result in window.hashchange firing multiple times: once from the initial change, and again for each of the dependent selects' change handlers.

If the hashchange handler is开发者_运维知识库 expensive (or not idempotent) this can be a problem. What's the best way to prevent this from happening?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜