简体   繁体   English

为什么这个按钮在IE中工作但在Firefox中不起作用?

[英]Why this button works in IE but not in Firefox?

I have strange issue and I don't know how to fix. 我有一个奇怪的问题,我不知道如何解决。 This button works perfectly in IE , but not in Firefox. 此按钮在IE中完美运行,但在Firefox中无效。 This is the HTML code: 这是HTML代码:

<div class="divbutonSave" onclick="Save()" style="float: right;">
<span>Save</span>
</div>

And this is the Javascript code: 这是Javascript代码:

 function Save() {
var poz = '1';
var rowCount = dataTable.rows.length;
var ala0 = "";
for (var i = 1; i < rowCount; i++) {
var c = document.getElementById("chk " + i);
if (c.checked == 1)
ala0 += dataTable.rows[i].cells[1].innerText + "^";
var ala = ala0.substring(0, ala0.length - 1);
}
$.ajax({
url: '/ProjectAdministrator/ProjectAdministratorProject/Partners',
data: { pozActivity: poz, listapart: ala },
dataType: "Json",
type: "POST",
error: function () {
alert("Error");
},
success: function (data) {
window.close();
}
});
} 

Any suggestions? 有什么建议么? Thanks in advance 提前致谢

I'd suggest if you want a button, you should use a button in your markup, rather than a div . 我建议如果你想要一个按钮,你应该在你的标记中使用一个button ,而不是div That way your markup will represent what it means, and it may have the side effect of working properly too. 这样你的标记将代表它意味着什么,它也可能具有正常工作的副作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM