【发布时间】:2014-11-13 20:17:41
【问题描述】:
// From Ctp
hcp_btn.on('click', function(){
var value = hcp_field.val();
if(value != '')
{
$.ajax(
{
type: 'POST',
url: ajax_url+'users/add_hcp_type/'+value,
success:function(response)
{
if(response == 'exist')
{
$("#hcp_error").show();
hcp_btn.addClass('disabled');
}
else{
$("#hcp_type_modal").modal('hide');
$("#hcp_type").html(response);
}
}
});
}
});
// For Controller
$this->autoRender = false;
$this->layout = 'ajax';
$this->viewPath = 'Elements';
$this->render('hcp_types');
![This type of background left after modal close in ajax success function][1]
我正在使用 cakephp 并使用 ajax 渲染元素并在 ctp 中动态加载数据。但是在 ajax 成功函数中获得 ajax 响应后,我试图关闭引导模式 nut modal 没有完全关闭一些透明背景。
【问题讨论】:
标签: ajax twitter-bootstrap cakephp response