Fancebox ajax post in iframe

is it possible to use fancybox to publish var to iframe on opening?

I currently have:

function fancyBoxLoad(element) {
    var elementToEdit = $("#" + $(element).attr("class"));
    var content = encodeURIComponent($(elementToEdit).outerHTML());
    $.fancybox(
        { 'href': 'loadEditor.php' },
        {
            frameWidth: 750,
            frameHeight: 430,
            overlayShow: true,
            ajax: {
                type: "POST",
                data: 'content=' + content
            },
            type: 'iframe'
        }
    );
}

It seems that if I remove type: 'iframe', it will publish the data, but it will not appear in the iframe, and if I remove ajax: { type: "POST", data: 'content=' + content }, it will open in the iframe instead, but will not publish the data (the example above does the same)

So my question is: can this be done?

+3
source share
2 answers

iframe, fancybox iframe, , , , fancybox , . , . iframe, .

+1

Fancybox v1.3.1, . , , GET HREF . , AJAX, , GET.

0

Source: https://habr.com/ru/post/1725468/


All Articles