How to stay inside a lightbox

While inside a lightbox, I want to execute the following code and still remain in the lightbox. Currently it displays the results in the main browser window. I tried removing “parent” from the code below, but this did not help.

echo "<script type='text/javascript'>parent.location.href = 'popupMember.php?action=view&uID=$uID';</script>";

Thank you!

Lightbox is just a div stylized to be on top of your page
That means you can’t load content to that div with location.href (because it will change entire page)
You should use AJAX
Example for jQuery:

echo "<script>$('#lightbox-div-id').load('popupMember.php?action=view&uID={$uID}');</script>";

where #lightbox-div-id is DOM identifier of your lightbox “window”

also i’d recommend to look at your lightbox script documentation
very often such scripts already have a native way to load content with AJAX

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.