'); $('#form-upload input[name=\'file\']').trigger('click'); if (typeof timer != 'undefined') { clearInterval(timer); } timer = setInterval(function () { if ($('#form-upload input[name=\'file\']').val() != '') { clearInterval(timer); $.ajax({ url: '/tool/upload', type: 'post', dataType: 'json', data: new FormData($('#form-upload')[0]), cache: false, contentType: false, processData: false, beforeSend: function () { $(node).button('loading'); }, complete: function () { $(node).button('reset'); }, success: function (json) { $('.text-danger').remove(); if (json['error']) { $(node).parent().find('input').after('