ssm中ajax无反应,jquery + bootstrap(模态框romote) + click -> ajax + SSM插入数据库没反应...

点击产生模态框,模态框使用remote远程加载。然后在模态框输入数据,ajax传输到后台insert。

但是click动作后模态框消失,数据库没有插入,没有报错,就好像没有执行js的click一样,求大神!

//newBar点击之后模态框开启

var time = 0;

$('#newBar').click(function(){

if(time == 0){

$('#newBarModal').modal({

backdrop: 'static',

keyboard: false,

remote: 'myBar/newBar'

});

time++;

}else{

$('#newBarModal').modal({

backdrop: 'static',

keyboard: false,

remote: 'myBar/resultBar'

});

}

})

//newBarModal是模态框ID

$('#newBarModal').on("hidden.bs.modal", function() {

$('#newBarModal').removeData("bs.modal");

$(this).find(".modal-content").children().remove();

});

//sendBar就是那个按钮

$("#sendBar").click(function(){

alert("over");

var masterID = $('#in-masterID').val();

var topic = $('#in-topic').val();

var content = $('#in-content').val();

$.ajax({

url: "myBar/sendBar",

type : "post",

contentType : "application/json;charset=utf-8",

data : JSON.stringify({masterID:masterID,topic:topic,content:content}),

beforeSend: function () {},

success : function(){

},

error : function(){

alert("error!");

}

})

})

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值