Jquery 文档更改事件除了Chromium之外没有触发任何事件
我将这个JS作为一个单独的文件加载,所以在页面完全加载后,它就可以使用了:Jquery 文档更改事件除了Chromium之外没有触发任何事件,jquery,Jquery,我将这个JS作为一个单独的文件加载,所以在页面完全加载后,它就可以使用了: //now load the values from the retrieved table, after a change initiated by user $(document).change(function() { //all formulae go below here: // Ordered trays formula $('tabl
//now load the values from the retrieved table, after a change initiated by user
$(document).change(function() {
//all formulae go below here:
// Ordered trays formula
$('table.gt-table tbody tr').each(function() {
var tray = 0;
var ordcell = 0;
var traycode= $(this).find("td.gt-col-mygrid1-trays_code div").html();
var ordcells= $(this).find("td.gt-col-mygrid1-ordered_cells div").html();
if (parseInt(traycode) >0) {
tray = parseInt(traycode);
} else {
tray = 0;
}
if (parseInt(ordcells) >0) {
ordcell = parseInt(ordcells);
} else {
ordcell = 0;
}
if (tray > 0 && ordcell > 0) var ordtrays = ordcell/tray;
if (ordtrays > 0){
$(this).find("td.gt-col-mygrid1-ordered_trays div").html(ordtrays);
}
});
// end Ordered trays formula
alert("boo");
}); // end the window change function
但它只在铬中工作。当文档被编辑时,Opera和Firefox都不会发出“boo”(这是一个有可编辑单元格的Sigma网格)
有什么想法吗?我相信
文档
上的更改
事件在HTML5规范中是一件新鲜事(我在[http://www.HTML5规范中没有找到它,它定义了输入
、文本区
、以及选择
]),尽管HTML5规范中提到了它,据我所知,根本没有具体说明。所以我怀疑它还没有得到广泛的支持。你能给我们展示一下用来包含这个外部JS
资源的include标签吗?是包含标签…它被包含得很好,并且在检查器中可见。嗯,很好。铬18是我的工作;显然,它是包括这一能力领先于其他。因此,我想答案是尝试解决表本身的更改。