onclick事件不'不适用于Firefox-适用于Internet Explorer
onclick-event doesn't work in Firefox - works in Internet Explorer
我实现了一个名为:remove(this)的onclick事件。它在Internet Explorer中运行良好,但在Firefox中则不然。我在remove函数上设置了一个断点,所以我看到IE调用了这个函数,而FF没有(使用Firebug和IE DeveloperTools首次亮相)
Internet Explorer:
<INPUT onclick="remove( this )" id=NBGTEST-1075_0002__Update__DeleteButton
title="Remove Spawn" class="update field-button" type=button value=Delete
name=NBGTEST-1075_0002__Update__SpawnButton>
Firefox:
<input id="NBGTEST-1075_0005__Update__DeleteButton"
class="update field-button" type="button" onclick="remove( this )"
value="Delete" title="Remove Spawn" name="NBGTEST-1075_0005__Update__SpawnButton">
输入按钮有相同的参数,只是顺序不同,但这不应该是错误。
这个程序:有一个按钮a。当单击按钮a时,将生成一个按钮B。按钮B可以拆下。函数remove()-再次删除按钮。当我按下删除按钮时,按钮会被隐藏,但行仍然可见。该行将在remove()函数中删除
按钮A的代码(添加按钮):
IE:
<INPUT onclick="add( this )" id=NBGTEST-1075_Main__Update__SpawnButton
title="Create Spawn" class="update field-button" type=button value="Add Spawn"
name=NBGTEST-1075_Main__Update__SpawnButton>
FF:
<input id="NBGTEST-1075_Main__Update__SpawnButton" class="update field-button"
type="button" onclick="add( this )" value="Spawn MR" title="Create Spawn"
name="NBGTEST-1075_Main__Update__SpawnButton">
两个浏览器都会触发add(this)事件。
我用IE11和FF 32.0.3 进行了测试
有趣的事实:当我在Firefox中创建一个Internet Explorer选项卡时,它也能工作
删除功能:
function remove( button )
{
if( isButton( button ) && isUpdateSection( button.id ) )
{
//here I remove the button/row
}
return( false );
}
我修复了它。我只是在removes()中更改了函数名。据推测,remove()是一个内部javascript函数,firefox使用该函数。相反,InternetExplorer检测到我定义了自己的remove()函数。
相关文章:
- html5 drawImage适用于firefox,而不是chrome
- JS适用于Firefox和Safari,但不适用于Chrome.此处'是我的网站
- 通过单击主菜单外部关闭子菜单'不适用于IE,但适用于Firefox&铬
- jQuery放大版不适用于Chrome和Safari,但适用于Firefox
- JavaScript调整iFrame大小-适用于Firefox/IE,但不适用于Chrome
- jquery脚本仅适用于firefox
- CSS/JQuery/Javascript加载图标仅适用于firefox
- jquery 2.2 serializeArray()适用于Firefox、Chrome,但不适用于IE(11)
- Ajax,Php-Postback仅适用于Firefox
- jQuery scrollTop()-仅适用于Firefox,不适用于Chrome
- AngularJS下拉菜单适用于Firefox,不适用于Chrome和Safari
- 在 javascript 中更改图像 .style 仅适用于 Firefox
- JS幻灯片适用于Firefox和chrome,但不适用于Internet Explorer
- jquery datatable oTable.$ 适用于 Firefox,但不适用于 Chrome
- 为什么这适用于Firefox,但不适用于Chrome或IE
- Javascript 适用于 Firefox 和 Chrome,但不适用于 IE
- Javascript适用于Firefox而不是IE.为什么
- 删除cookie(PHP,JS)适用于Firefox,Safari,Opera,但不适用于Chrome
- JavaScript脚本适用于Firefox,Chrome,Safari,Internet Explorer< 9,但不
- Web Audio onaudioprocess适用于Firefox,JSFiddle适用于Chrome,但不适用于Ch