有人知道这方面的解决方法吗?我正在尝试使用选择元素进行导航。看起来像这样;
<select onchange="window.location=(this.options[this.selectedIndex].value)">
它适用于所有桌面浏览器,也适用于我的 WP7 手机。它不适用于我的 iPhone (iOS 5.0)。
最佳答案
当您更改其输入值时,iOS 往往不会触发 change
事件。我有 documented this in more depth at the Device-Bugs tracker .
解决方法是改为绑定(bind)到 blur
事件。在上面的示例中,使用 onblur
就可以了。
<select onblur="window.location=(this.options[this.selectedIndex].value)">
关于javascript - iOS 选择 onchange 不触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8004227/