/    Sign up×
Community /Pin to ProfileBookmark

closing stuff!

ok…i have made my page open a remote window…it opens the other window as an html file…like…ok

how can i make the main window close the remote window, knowing the remote window’s “name”…?

~John

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@khalidali63Jan 18.2003 — just use the following format

popupWindowName.close();

this should it for you.

cheers

Khalid
Copy linkTweet thisAlerts:
@SearedIceauthorJan 18.2003 — the problem is that the name of the window is a variable...
Copy linkTweet thisAlerts:
@khalidali63Jan 18.2003 — thats not a problem,thats preciesly how one would achieve this.

var newWin = window.open()

and then call this from anywhere you want

newWin.close();

please keep in mind the scope rules of a variable

Khalid
Copy linkTweet thisAlerts:
@SearedIceauthorJan 18.2003 — i'll explain more...

i have a function...

the function has a for loop...

the for loop opens 3 windows, and makes the window's name the value of the for loop's variable as it opens the window

thus, 3 windows pop up with the names "1" "2" and "3"

...now...i have it wait two seconds after that loop with a settimeout

then, i have another for loop that (should) close the 3 windows

i'm trying to make that for loop that does the closing close each window by the loop's variable's value...thus it closes window "1", then "2", and finnally "3"
Copy linkTweet thisAlerts:
@khalidali63Jan 18.2003 — try the zipped solution,

hope this helps

cheers

Khalid

[upl-file uuid=a2f7e22a-a5ba-4252-a7c9-1ad5cfef4e49 size=769B]searedice-loopwinopenclose.html.zip[/upl-file]
Copy linkTweet thisAlerts:
@SearedIceauthorJan 19.2003 — gee...your idea seems to be what i need...i hafta get off right now and don't have enough time to play with it/ see if it is really what i want but it looks like it is

um...can i change around stuff and give you credit in the source for helping and it mostly being yours?
×

Success!

Help @SearedIce 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.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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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