
$('.add_group').click(function(){
$.ajax({
url: "<{:url('user_group/add')}>",
dataType: 'html',
waitting: true,
success: function(html) {
var $html = $('<div class="dialogModal">' + html + '</div>');
var $form = $html.find('form');
if ($form.length == 0) {
var $modal = $html.find('.modal:eq(0)');
} else {
var $modal = $form.find('.mymodal');
console.log($modal);
}
if ($modal.length == 0) {
alert(html, 'warning');
return;
}
$html.appendTo('body');
$modal.modal().show();
$modal.on('hide', function() {
$html.remove();
});
}
});
})
public function add()
{
return $this->fetch();
}
最佳答案
