Link to home
Start Free TrialLog in
Avatar of catonthecouchproductions
catonthecouchproductionsFlag for United States of America

asked on

Lightbox - Javascript - refresh

If you go to http://www.newspapersofamerica.com/new/ and click "Login" on the top right

You can use demo/demo to login

When you login, click logout at the top it brings up the other lightbox, when you click logout see how it still shows it at the top, but if you refresh it removes it, I want to have it say "login" not the:

Welcome demo, you are logged in, logout.

Any ideas? I am using this: http://jquery.com/demo/thickbox/ for that effect.

Thanks,

Ryan
Avatar of contactkarthi
contactkarthi
Flag of United States of America image

once you close the popup after clicking esc or the close link... se if you can refresh the parent page which clears the message and shows the login page.
Avatar of catonthecouchproductions

ASKER

How would I refresh the page? I want to see if I can do it automatically after I click the logout and when it goes back I want it to refresh the page.
Once you click logout and close the box and refresh it does log you out, but when you click logout, I want it to do it automatically refresh the page, so when you close it, it says "Login" not the Logout.
instead of calling the logout php from href call a script method and from there call it like below

window.showModalDialog(url);
self.document.location.reload(true);

hope it helps
So I have:

<a href="logout.php?height=135&amp;width=300" class="thickbox" title="Log out">Welcome '. $s_username . ', you are logged in, logout.</a>

Instead of making it that, you said use:

window.showModalDialog(url);
self.document.location.reload(true);

How would i add in what you said?

Thanks,

Ryan
something like

<a href="javascript:myfunction()" class="thickbox" title="Log out">Welcome '. $s_username . ', you are logged in, logout.</a>

function myfunction()
{
window.showModalDialog("logout.php?height=135&amp;width=300");
self.document.location.reload(true);
}
If you try it now it just shows a the blacked out page with no lightbox, any ideas?

Thanks,
Ryan
not sure what is wrong here...

or revert it to the one you had earlier and in the logout.php try this

<body onunload="window.opener.location.reload();">
Nope, it still has you logged in after you click close.

Any ideas?

Thanks for your help!
I would have thought that that code above would have worked.
ASKER CERTIFIED SOLUTION
Avatar of contactkarthi
contactkarthi
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you for your help!

Ryan
I have this question as well if you are intersted, I cant figure it out! haha.

Thanks again,

Ryan