为什么这个按钮在IE中工作,而不是在Firefox? [英] Why this button works in IE but not in Firefox?
本文介绍了为什么这个按钮在IE中工作,而不是在Firefox?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是HTML代码:
< div class =divbutonSaveonclick =Save()style =float:right;>
< span>保存< / span>
< / div>
这是Javascript代码:
function Save(){
var poz ='1';
var rowCount = dataTable.rows.length;
var ala0 =; (var i = 1; 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 :$ J $,
类型:POST,
错误:function(){
alert(Error);
},
success:function数据){
window.close();
}
});
}
有什么建议吗?在此先感谢
解决方案
我建议如果你想要一个按钮,你应该使用 / code>,而不是
div
。这样你的标记就代表了它的意思,也可能有正常工作的副作用。
I have strange issue and I don't know how to fix. This button works perfectly in IE , but not in Firefox. This is the HTML code:
<div class="divbutonSave" onclick="Save()" style="float: right;">
<span>Save</span>
</div>
And this is the Javascript code:
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
. That way your markup will represent what it means, and it may have the side effect of working properly too.
这篇关于为什么这个按钮在IE中工作,而不是在Firefox?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文