在 Facebox 内重定向的链接(不会中断)

发布于 2024-08-24 01:48:57 字数 268 浏览 3 评论 0原文

如何在 Facebox 窗口中创建一个链接,将其重定向到另一个页面而不中断?

我尝试使用一个效果很好的 iframe...除了我想在 Facebox 中显示的初始内容是一个简单的消息和一个链接。然后,我希望链接在单击后重定向到页面。

由于 iframe 需要 src,因此页面上没有我可以编写消息的位置。我唯一的想法是为 iframe 生成一个 src,该 iframe 将消息作为 url 上的参数传递到回显该消息的 php 页面(相当难看的解决方案)。

有更好的办法吗?

How can make a link within a facebox window that redirects it to another page without breaking out?

I tried using an iframe which worked nicely... except the initial content I want to display in the facebox is a simple message and a link. I then want the link to redirect to a page if clicked.

As iframes require a src there is no where on the page I can write the message. My only thought was to generate a src for the iframe that passed the message as a parameter on a url to a php page that echoed the message (quite an ugly solution).

Is there a better way?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

如果没有你 2024-08-31 01:48:57

好吧,您可以使用 ajax 来简单地替换 Facebox 的内容。

$("#mylink_id").click(function() {
    $("#content_id").load($(this).attr('href'));
    return false;
});

Well, you could use ajax to simply replace the contents of the facebox.

$("#mylink_id").click(function() {
    $("#content_id").load($(this).attr('href'));
    return false;
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文