/    Sign up×
Community /Pin to ProfileBookmark

Javascript code to close current window and call link at the last page

Hello,

I hope what I’m looking for isn’t on this forum because I searched and I found nothing. I’m afraid I might be explaining it the wrong way to the search engine.

Basically, I have a site that calls different windows to open separetely. They also close fine within themselves. at some point the visitor has too many windows open, so I need a script that will close the current open window when clicking on a link, (not the close this window link) and the page builds up on the original page the window was opened from.

I hope I’m not confusing you.
Can you please help me?

Thanks in advance.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@scragarOct 28.2007 — is this any sort of help?[code=html]<script type="text/javascript">
var x;
function wopen(){
x = window.open("URL");
};
function wclose(wname){
if(wname)
wname.close();
};
</script>
<a href="#" onclick="wopen();">open 1</a>
<a href="#" onclick="wclose(x);">close 1</a><br>
<a href="URL" target="yz">open 2</a>
<a href="#" onclick="wclose(yz);">close 2</a>[/code]
×

Success!

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