switch(_this.data(‘act’)) { case ‘setfilter’: $.ajax({ url: _this.prop(‘href’), dataType: «json», type: «POST», data: (datas = $.extend({}, _this.data()), $(‘#performedwork input’).map(function(i,o){ return ( t={}, t[$(o).prop(‘name’)]=$(o).val(), t ); }).each(function(i,o){ $.extend(datas, o) }), datas ), success: function( d ) { if (d.error.length) { bootbox.dialog({ title: ‘<div class="text-danger">Ошибка</div>‘, message: ‘<div class="text-danger">«</div>‘, onShown: function() { this.find(‘.bootbox-body > div’).text(d.error); } }); } else {
Create an object property from a variable value in JavaScript
Создаем объект со свойством равным значению переменной