Jquery 带有.post()请求的Colorbox
我尝试在jquery.post()之后使用open colorbox;请求,加载我发布到的页面,但我有一个问题。我正在打开该页面的一个新实例,该实例未收到发布的数据Jquery 带有.post()请求的Colorbox,jquery,colorbox,.post,Jquery,Colorbox,.post,我尝试在jquery.post()之后使用open colorbox;请求,加载我发布到的页面,但我有一个问题。我正在打开该页面的一个新实例,该实例未收到发布的数据 $.post( "/shop/checkout.php", { shipping: shipping }, function(data) { $.colorbox({top: 50,scrolling:false,preloading:false,href:"/shop/checkout.php"}); } );
$.post( "/shop/checkout.php", { shipping: shipping },
function(data) {
$.colorbox({top: 50,scrolling:false,preloading:false,href:"/shop/checkout.php"});
}
);
我用过firebug,这篇文章成功地获得了正确的数据。但是,当我在colorbox中加载checkout.php时,它是checkout.php的一个实例,没有收到数据。您已经在
post
回调中有了数据,只需使用html
选项将数据提供给colorbox
。您不必设置href
选项
$.post( "/shop/checkout.php", { shipping: shipping },
function(data) {
$.colorbox({
top: 50,
scrolling: false,
preloading: false,
html: data
});
}
);