我一直在尝试为我的网站使用引导模式。现在我需要更改以下代码以与模态一起使用
$(document.body).on('click','.socialIcon',null,function() {
var id = $(this).attr('id').replace('social_','');
var win = function(resp) {
var dialogWin = $('#socRegPopup');
if(dialogWin.length){
dialogWin.remove();
}
$('#wrapper').append(resp);
dialogWin = $('#socRegPopup');
dialogWin.dialog({
autoOpen: true,
width: 515,
modal: true,
position: 'center',
resizable: false
});
};
$.ajax({
url: liveSite +'/index2.php?obj=social&task=getSocialForm',
type:'get',
data: {programId: id},
success:win});
});
我尝试将其更改为此以使用引导模式
$(document.body).on('click','.socialIcon',null,function() {
var id = $(this).attr('id').replace('social_','');
var win = function(resp) {
$('#wrapper').append(resp);
$('#socRegPopup').modal();
};
$.ajax({
url: liveSite +'/index2.php?obj=social&task=getSocialForm',
type:'get',
data: {programId: id},
success:win});
});
这个可行,但问题是数据没有改变,例如当我单击按钮 1 时有 3 个按钮,它将输出正确,但接下来的所有按钮将输出按钮 1 数据。任何指南如何使模态在 ajax 上工作