簡體   English   中英

使用fancybox的AJAX發布不起作用

[英]AJAX post using fancybox doesn't work

我的腳本:

$("#sl_selections").fancybox({
    'width'             : 370,
    'height'            : 480,
    'autoDimensions'    : false,//(width != '' || height != '' ? false : true),
    'autoScale'         : false,
    'showCloseButton'   : false,
    'titleShow'         : false,
    'padding'           : 0,
    'href'              : $('#itemInteractivity .copyMove a').attr('href'),
    'ajax'              : { data:  acao,type: 'post' }
});  

在PHP中返回一個空的帖子。 如果我這樣做很有趣:

$.ajax({
    type:           'post',
    cache:          false,
    url:            $('#itemInteractivity .copyMove a').attr('href'),
    data:           {data:  acao}
});

工作正常,有什么主意嗎?

舊問題,但沒有可接受的答案。

使用Fancybox 2,我可以通過AJAX獲得帖子,以使用以下配置:

$.fancybox.open({
    type: "ajax",
    ajax: {
        dataType: "html",
        type: "POST",
        data: {
            "foo" : "bar",
            "foo2" : "test"
        }
    },
    href: "url-to-post-to.php"
})

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM