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

时间:2014-10-16 22:58:26

标签: javascript jquery html5

代码适用于Chrome和Firefox,但不适用于IE。不知道为什么。请指教!感谢

背景:选择目标语言环境并在用户点击“点击此处下载”按钮下载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>

1 个答案:

答案 0 :(得分:0)

尝试将window.top.location = "NEW_URL"用于IE。或者,如果您的代码是从iframe运行的,parent.location = "NEW_URL"