/    Sign up×
Community /Pin to ProfileBookmark

<js> Change parent.window src then iframe src

Hello!

I’ve come to a problem and I’ve got no idea how to fix this, when I press the logout button I want the website to completely refresh and then change the iframe src/href.

[CODE]
<script type=’text/javascript’>
parent.window.location=’http://mydomain.com’; // parent
window.location=’http://mydomain.com/php/account.php?action=login&message=logout’; // iframe
</script>
[/CODE]

My website is running iframe therefor I need to refresh parent window(to get rid of menu items when logged in) then change the iframe src to the src above.

I know this is possible by $_GET function but I’ve restricted the domain so the domain can only be [url]http://mydomain.com[/url] not *.com?logout=true etc.

Thanks in advance!
Soder.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@soder_authorApr 19.2012 — Bump!
Copy linkTweet thisAlerts:
@Troy_IIIApr 19.2012 — Not doable
Copy linkTweet thisAlerts:
@KorApr 20.2012 — If you talk about[I] logout[/I], that means you can create a session variable on [I]login[/I], so that afterwards you may simply reload the parent, using javascript, but [I]after[/I] you have sent an AJAX request to a third PHP file which will close the session and kills the session's variables. You parent document should have a simple PHP code detector which will check if the session variable exists. If no, it should open in its iframe the "logout" document.
×

Success!

Help @soder_ spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...