/    Sign up×
Community /Pin to ProfileBookmark

Problem with window.close

Hi,

Maybe the solution is easy, but I can’t find it or can’t find out how to. This is the situation:

I am opening a new window in fullscreen mode:

window.open(“index1024.htm”,”hoofdscherm”,”fullscreen=yes,dependent”)

The new window consists of frames:

<FRAMESET ROWS=”148,50,500,70″ FRAMEBORDER=”0″ FRAMESPACING=”0″ BORDER=”0″>
<FRAME WIDTH=1024 SRC=”1024top.htm” NAME=”top” TITLE=”top” NORESIZE MARGINWIDTH=”0″ MARGINHEIGHT=”0″ SCROLLING=”no” BORDER=”0″>
<FRAMESET COLS=”338,620,66″ FRAMEBORDER=”0″ FRAMESPACING=”0″ BORDER=”0″>
<FRAME SRC=”1024r2c1.htm” NAME=”r2c1″ TITLE=”r2c1″ NORESIZE MARGINWIDTH=”0″ MARGINHEIGHT=”0″ SCROLLING=”no” BORDER=”0″>
<FRAME SRC=”titel.htm” NAME=”titel” TITLE=”titel” NORESIZE MARGINWIDTH=”0″ MARGINHEIGHT=”0″ SCROLLING=”no” BORDER=”0″>
<FRAME SRC=”1024r2c4.htm” NAME=”r2c4″ TITLE=”r2c4″ NORESIZE MARGINWIDTH=”0″ MARGINHEIGHT=”0″ SCROLLING=”no” BORDER=”0″>
</FRAMESET>
<FRAMESET COLS=”72,880,66″ FRAMEBORDER=”0″ FRAMESPACING=”0″ BORDER=”0″>
<FRAME SRC=”1024r3c1.htm” NAME=”r3c1″ TITLE=”r3c1″ NORESIZE MARGINWIDTH=”0″ MARGINHEIGHT=”0″ SCROLLING=”no” BORDER=”0″>
<FRAME SRC=”main.htm” NAME=”main” TITLE=”main” NORESIZE MARGINWIDTH=”0″ MARGINHEIGHT=”0″ SCROLLING=”auto” BORDER=”0″>
<FRAME SRC=”1024r3c4.htm” NAME=”r3c4″ TITLE=”r3c4″ NORESIZE MARGINWIDTH=”0″ MARGINHEIGHT=”0″ SCROLLING=”no” BORDER=”0″>
</FRAMESET>
<FRAME SRC=”1024bottom.htm” NAME=”bottom” TITLE=”bottom” NORESIZE MARGINWIDTH=”0″ MARGINHEIGHT=”0″ SCROLLING=”no” BORDER=”0″>
</FRAMESET>

Now I want to have a link or button in the frame “main” to close this fullscreen window. I have tried several ways (like window.close and opener.close) but nothing works. Nothing happens when I click the link, the window will not close.

Can anyone help me with this?

Thank you.
Richard Krol

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisApr 02.2003 — Your scope is wrong. You cannot close a frame window - you have to close the frameset window. Use:window.top.close();
Copy linkTweet thisAlerts:
@KrolauthorApr 02.2003 — Thank you for your quick answer, that did the trick, it works.
×

Success!

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