/    Sign up×
Community /Pin to ProfileBookmark

How can I tell pageOne to close pageTwo?

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@fredmvJan 21.2004 — What exactly are those? Variables? If so, are they references to new windows (i.e., [font=courier]window.open[/font])? More information is needed to provide an accurate answer.
Copy linkTweet thisAlerts:
@NatdripauthorJan 21.2004 — [URL=http://forums.webdeveloper.com/showthread.php?s=&threadid=25858]click here[/URL]

this is what I am tring to figure out using these pages??
Copy linkTweet thisAlerts:
@fredmvJan 21.2004 — No need to double-post. You could've just contined this in the thread you already started. Anyway, try something like this:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>untitled</title>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" />
<script type="text/javascript">
//<![CDATA[
function createTwo()
{
var d = 'width=300,height=250';
w1 = window.open('','',d);
w1.document.write('<h1>child 1</h1><a href="#" onclick="opener.w2.close();return false;">close child 2</a>');
w1.document.close();
w2 = window.open('','',d);
w2.document.write('<h1>child 2</h1>');
w2.document.close();
}
//]]>
</script>
</head>
<body>
<a href="#" onclick="createTwo();">Create two child windows.</a>
</body>
</html>
Copy linkTweet thisAlerts:
@NatdripauthorJan 21.2004 — ?

Yeah I've already solved the problem like this but then what happens if page 1 don't exist? I am un able to close page 2 and 3.

but then if page 1 didn't exist I would want to have page 3 be able to close it's self and set focus on page 2? with or with out the opener ref how am I to do this? ?

sorry for not being clear on this point :rolleyes:
×

Success!

Help @Natdrip 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 6.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...