2014-10-16 169 views
0

代碼適用於Chrome和Firefox,但不適用於IE。不知道爲什麼。請指教!謝謝代碼適用於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> 

回答

0

嘗試爲IE使用window.top.location = "NEW_URL"。或者,如果你的代碼是從iframe運行,parent.location = "NEW_URL"

+0

感謝您的幫助,但它似乎並沒有工作。 – 2014-10-17 06:18:41