大家好,有一种方法可以使用带有ajax的大胆弹出窗口,一旦触发了大量的弹出窗口,我将使用它来插入数据。
这是我的代码:
$(function () {
$('.popup-modal').magnificPopup({
$.ajax({
type: "POST",
url: "insertVote.php",
data: dataString,
cache: false,
success: function(html) {
parent.html(html);
}
});
});
return false;
答案 0 :(得分:3)
你需要使用回调函数:
$('.popup-modal').magnificPopup({
callbacks : {
open : function(){
$.ajax({
type: "POST",
url: "insertVote.php",
data: dataString,
cache: false,
success: function(html) {
parent.html(html);
}
});
}
}
});