我有一个简单的 html 页面,可以基于 OPTION 列表打开不同的 HTML,使用 ON CHANGE 来触发 WINDOW.OPEN,在 IE8 中,当我选择 May10 时,我得到一个窗口出现并快速消失。当我选择 SFAA 或 google 时,它工作正常,使用 HREF 打开 xls 文件也工作正常。
我在 Firefox(3.6.13)、chrome 中尝试了这个,一切正常。
`<select name="target"
onChange="if (this.options[this.selectedIndex].value != '')
{window.open(this.options[this.selectedIndex].value,'_blank');};" >
<option VALUE="" style="color:#000000;">Select</option>
<option VALUE="http://www.google.com">google</option>
<option VALUE="../May10.xls">May 10</option>
<option value="../sfaa.pdf">SFAA</option>
</select>`
window.open(this.options[this.selectedIndex].value,'_blank'); 在 IE8 中不起作用。'_parent' 或 '_self' 也适用于 IE8。在 Firefox 和 google chrome 中一切正常