Php 如何将放大弹出窗口与ajax帖子和url一起使用?

Php 如何将放大弹出窗口与ajax帖子和url一起使用?,php,jquery,ajax,Php,Jquery,Ajax,大家好,有没有一种方法可以在ajax中使用放大弹出窗口,一旦触发放大弹出窗口,我将使用它插入数据 这是我的密码: $(function () { $('.popup-modal').magnificPopup({ $.ajax({ type: "POST", url: "insertVote.php", data: dataString, cache: false, success: function(html) { pare

大家好,有没有一种方法可以在ajax中使用放大弹出窗口,一旦触发放大弹出窗口,我将使用它插入数据

这是我的密码:

$(function () {

    $('.popup-modal').magnificPopup({

    $.ajax({
    type: "POST",
    url: "insertVote.php",
    data: dataString,
    cache: false,

    success: function(html) {
    parent.html(html);
     }  
}); 

    });
return false;

您需要使用回调函数:

$('.popup-modal').magnificPopup({

  callbacks : {

    open : function(){
       $.ajax({
          type: "POST",
          url: "insertVote.php",
          data: dataString,
          cache: false,
          success: function(html) {
             parent.html(html);
          }  
       });
    }
  }
});

你面临的错误是什么?检查错误控制台。看不出原因。如果你有理由相信,请分享