【发布时间】:2011-07-25 10:51:52
【问题描述】:
所以我使用了一个带有国家列表的 HTML 选择框和一个按钮来打开一个小窗口,其中包含 HTML 选择框中所选项目的更多详细信息。
我是这样做的(我提前为这里的任何无聊表示歉意,我对 Javascript 还是很陌生):
//in header
<script type="text/javascript">
function popUp()
{
countryName = document.getElementById("countrylist").value;
document.write(countryName);
dest = "countries/" + countryName + ".html";
window.open(dest, 0, "toolbar=0, scrollbars=0, statusbar=0, menubar=0,resizable=0,width=400,height=400,left=440,top=312");
}
</script>
<form id="countryform">
<select id="countrylist">
<!--List of countries removed for brevity-->
</select>
<input type="button" name="countryBtn" value="Submit Query" onClick="popUp();">
</form>
这在 Firefox 中运行良好,但在 IE6 中不行。任何帮助将不胜感激!
更新:所以我尝试了下面的前两种方法,替代弹出功能在任一浏览器中都不起作用,替换 document.getElementById 行没有改变任何东西,在 Firefox 中仍然可以正常工作, 不在 IE 中。
【问题讨论】:
标签: javascript html internet-explorer-6