我有这个Mootools 1.1脚本,在提交表单后更新div,
尝试将其转换为mootools 1.2.4,但日志不起作用,我也没有收到任何错误
Mootools 1.1
$('myform').addEvent('submit', function(e) {
new Event(e).stop();
var log = $('log_res').empty().addClass('ajax-loading');
this.send({
update: log,
onComplete: function() {
log.removeClass('ajax-loading');
}
});
});
mootols 1.2
$('myform').addEvent('submit', function(e) {
new Event(e).stop();
var log = $('log_res').empty().addClass('ajax-loading');
this.set('send',{
update: log,
onComplete: function() {
log.removeClass('ajax-loading');
}
}).send();
});
答案 0 :(得分:1)
试试这个:
$('myform').addEvent('submit', function(e) {
e.stop();
var log = $('log_res').empty().addClass('ajax-loading');
this.set('send',{
url: this.get("action"),
data: this,
update: log,
onComplete: function() {
log.removeClass('ajax-loading');
}
}).send();
});