javascript On change event is not firing in Safari after selecting the dropdown value

不羁的心 提交于 2019-12-13 03:23:21

问题


I have a dropdown in my page. Whenever a user is selected the option it should open a new window with the selected index url. the below code is working in all browsers except safari.

Any idea to solve this issue..?

<form>
    <select class="searchboxproduct" style="width: 243px;" name="URL"  onchange="window.open(this.form.URL.options[this.form.URL.selectedIndex].value)">
        <option value="">select</option>
        <option value="www.gmail.com/">Gmail</option>
        <option value="www.google.com">google</option>
    </select>
</form>

回答1:


I've tried your code, it didn't open a new tab, either.
But when I set the safari settings to NOT block pop-up windows, it worked !
Therefore I don't think it's your code's problem.

larger size of picture is here



来源:https://stackoverflow.com/questions/19475814/javascript-on-change-event-is-not-firing-in-safari-after-selecting-the-dropdown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!