views:

151

answers:

1

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?

+1  A: 

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;
});
dale