求解一段ie与firefox中的脚本差异window.onload = function ff()
{
alert('YYY');
if (navigator.appName != 'Microsoft Internet Explorer')
{
alert('FF');
window.forward(1);
}
else
{
alert('IE');
history.forward(1);
}
}
window.location= 。为什么这样操作之后‘FF’和“IE”不能alert出来了呢?而且在firefox中不起作用,在ie中起作用.
请高人指点。
{
alert('YYY');
if (navigator.appName != 'Microsoft Internet Explorer')
{
alert('FF');
window.forward(1);
}
else
{
alert('IE');
history.forward(1);
}
}
window.location= 。为什么这样操作之后‘FF’和“IE”不能alert出来了呢?而且在firefox中不起作用,在ie中起作用.
请高人指点。
解决方案 »
- 如何动态的创建行和列?
- 在一个页面中载入同源的外部代码(需要同步实现)
- js控制div
- 做一个网上投票,怎样实现点击输入框时左侧的单选框自动选中?谢谢
- ie的blank页面被恶意更换
- 请看一面代码.想改成只显示一个层.然后从右向左飞.飞在屏幕的中间.速度试中.飞一次就行了.速度试中就行?
- JavaScript 初学,如何让动态显现的popup menu 正常无遮盖 在ActiveX控件上面显示
- 嵌入jspJavaScript做的状态栏条式的菜单,不能实现所有页的提交?请高手指教!
- 用一个链接打开一个CHM文件,但是要屏蔽“下载文件”这个窗口
- 5秒钟后自动转连接到别的网址(61分)
- rerurn出现问题(好像是无法接收)
- undefined和Undefined
{
alert('YYY');
if (navigator.appName != 'Microsoft Internet Explorer')
{
alert('FF');
window.forward(1);
}
else
{
alert('IE');
history.forward(1);
}
}
window.onload = ff;试一试呢?!
解决方法:
IE:
<input name="Button8_1" type="button" value="IE" onclick="javascript:gotoSubmit8_1()"/>
...
<script language="javascript">
function gotoSubmit8_1() {
...
alert(window.event); //use window.event
...
}
</script>
IE&Firefox:
<input name="Button8_2" type="button" value="IE" onclick="javascript:gotoSubmit8_2(event)"/>
...
<script language="javascript">
function gotoSubmit8_2(evt) {
...
evt=evt?evt:(window.event?window.event:null);
alert(evt); //use evt
...
}
</script>
http://www.yongfa365.com/Item/JavaScript-In-IE-Firefox.html