/    Sign up×
Community /Pin to ProfileBookmark

Hello

I have a pop-up window which I am quite happy with. What I wish to do, however, is insert a text link in the pop up which allows the user to go back to the normal size home page (index.html) while closing the pop up.

How can I do this?

Best wishes

LaTortuga

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@tobakeDec 12.2002 — I´m not really sure what you need. But if you want to return to the page that opened you popup window, you can do it like this:

<i>
</i>&lt;script&gt;
function goToOpener() {
window.opener.focus();
//if you also want to close the popup
this.close();
}
&lt;/script&gt;
&lt;a href="" onclick="goToOpener()"&gt;go to first win&lt;/a&gt;


//tobias
Copy linkTweet thisAlerts:
@laTortugaauthorDec 12.2002 — Hello ToBake

Many thanks for your reply and help.

From the pop up, I would want to go to the main home page (index.html) and not to the page with the pop up link on it. Would I substitute your

goToOpener

for

goToMain

Many thanks for any (extra) help.

Cheers

LaTortuga
Copy linkTweet thisAlerts:
@tobakeDec 12.2002 — ok then you can do like this:

<i>
</i>&lt;script&gt;
function goToOpener() {
window.opener.location.href="index.html";
window.opener.focus();
//if you also want to close the popup
this.close();
}
&lt;/script&gt;
&lt;a href="" onclick="goToOpener()"&gt;go to first win&lt;/a&gt;


what you name your function does not matter.

/tobias
Copy linkTweet thisAlerts:
@laTortugaauthorDec 12.2002 — Hello tobake

Many thanks again for your message.

It work fine! Thank you.

Your code suggests its own logic and you make it seem easy!

Thanks again and best wishes

laTortuga
×

Success!

Help @laTortuga 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.28,
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,
)...