简体   繁体   English

代码适用于Chrome和Firefox,但不适用于IE

[英]Code works in Chrome and Firefox but not in IE

The codes work in Chrome and Firefox but not in IE. 该代码在Chrome和Firefox中有效,但在IE中不起作用。 Not sure why. 不知道为什么。 Please advise! 请指教! Thanks 谢谢

Background : select the targeted locale and download the exe file when user click on the "click here to download" button. 背景 :当用户单击“单击此处下载”按钮时,选择目标语言环境并下载exe文件。

<html>
    <body>
        <p>Select language:<br />
            <select class="simpleFormSelect" id="h" name="list" xmlns="http://www.w3.org/1999/xhtml">
                <option value="exe download url here">English</option>
                <option value="exe download url here">Arabic</option>
                <option value="exe download url here">Chinese (Hong Kong)</option>
                <option value="exe download url here">Chinese (Simplified)</option>
            </select>
            <input onclick="top.location.href = $('#h').prop('options')[$('#h').prop('selectedIndex')].value;" type="button" value="Click here to Download" /> 
            (Download size: 6 MB)
        </p>
            <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.js"></script>
    </body>
</html>

Try to use window.top.location = "NEW_URL" for the IE. 尝试对IE使用window.top.location = "NEW_URL" Or, if your code is run from iframe, parent.location = "NEW_URL" 或者,如果您的代码是从iframe运行的,则parent.location = "NEW_URL"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM