1

我正在使用 Magento,并且我有一个自定义表单功能(在我的 controller.php 中),我想在完成后将用户重定向到 Fancybox。

这是我的 php 代码:

$this->_redirect('shop/myprofile');

我可以在 Fancybox 而不是主页中打开此链接吗?

还是另一种方式?

4

2 回答 2

1

如果你想在花式框中发布表单的数据,你可以使用 ajax 模式:

$("#a_id").fancybox({
        ajax : {
            type    : "POST",
            data    : 'mydata=test'
        }
    });

如果要在fancybox 中显示整页内容,可以使用 iframe 模式:

<a id="a_id" href="shop/myprofile">profile</a>

$("#a_id").fancybox({
     'type' : 'iframe'
});

请参阅http://fancybox.net/blog上的 API 文档和示例

但是你的问题不是很容易理解

于 2012-10-18T17:36:54.290 回答
0

为此,您需要使用一些 ajax。

像这样的东西

$("#divid").load("shop/myprofile")
于 2012-10-18T16:30:09.363 回答