表格发送Mootools 1.1到Mootools 1.2后更新div

时间:2011-03-10 21:40:36

标签: javascript mootools mootools1.2

我有这个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();
        }); 

1 个答案:

答案 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();
    });