2

我想在隐藏它时将多个值作为引导模式窗口之外的对象返回。我的代码是:

    modal.on('hide', function() {
        var o = new Object();
            o.formId = $(this).children('.modal-body').children('form').attr('id');
            o.schemaName = $(sn, modal).val();
        console.log(o)    // ->> this is works OK, obviously
    });

但我想要类似的东西:

    var ceva = modal.on('hide', function() {
        var o = new Object();
            o.formId = $(this).children('.modal-body').children('form').attr('id');
            o.schemaName = $(sn, modal).val();
        return o;
    });
    console.log(ceva);  // but this is returning all modal object instead o obj

任何建议将不胜感激。提前致谢!狮子座。

4

0 回答 0