/    Sign up×
Community /Pin to ProfileBookmark

popup windows – open AND close

Hello there,

I’d appreciate some help with a popup window that I’ve opened from my shockwave flash page.

The flash page opens my popup fine, using the following code:

code:——————————————————————————–on (release) {
getURL(“java script:NewWindow=window.open(‘pageone. html’,’windowone’,’width=348,height=290,left=0,top
=0,toolbar=No,location=No,scrollbars=No,status=No,
resizable=No,fullscreen=No’); NewWindow.focus(); void(0);”);
}——————————————————————————–

Now, the plan was, this particular popup window would have no scrollbars (this works fine). I then wanted to resize this window to fullscreen and open a new page insideit – but, to then activate scrollbars for this new page inside the popup that has no scrollbars.

As this seemed impossible, I’ve been trying to open my new page in a new popup window, and then get my previous popup window to close itself (behind my new popup window). A little sloppy . . . but it wouldn’t appear any different to the user.

This is what I’ve been trying:

code:——————————————————————————–on (release) {
getURL(“java script:NewNewWindow=window.open(‘pagetwo. html’,’windowtwo’,’width=348,height=290,left=0,top
=0,toolbar=No,location=No,scrollbars=Yes,status=No
,resizable=No,fullscreen=No’); NewNewWindow.focus(); void(0);”);
getURL(“java script:self.close()”);
}——————————————————————————–

Result – No new popup window, it just closes the popup.

Anybody able to lend me a helping hand to get this working?

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@LotusJul 09.2003 — Change the code into this:


getURL("java script:self.close()");

getURL("java script:NewWindow=window.open('pagetwo. html','windowtwo','width=348,height=290,left=0,top

=0,toolbar=No,location=No,scrollbars=Yes,status=No

,resizable=No,fullscreen=No'); NewWindow.focus(); void(0);");

That should fix it.
Copy linkTweet thisAlerts:
@__bluemoth__authorJul 09.2003 — Thanks. I'll give that a try.
Copy linkTweet thisAlerts:
@__bluemoth__authorJul 09.2003 — Checked it out.

The new scollbars enabled popup opens fine, but it's parent popup (self) will not close.

I've checked the syntax (even removed the window.open line), and the close script works fine by itself, as does the window.open script. But not together . . .

Any other suggestions . . . ?
Copy linkTweet thisAlerts:
@LotusJul 09.2003 — It seems as if you try to close the wrong name. Try:


getURL("java script:windowone.close()");
Copy linkTweet thisAlerts:
@__bluemoth__authorJul 09.2003 — Already tried that . . . and it din't work.

So, what I've done instead, is open my parent popup with scrollbars, and inserted a scrollbar hiding script in the page.

A little messy perhaps, but now when I open my new page without a scrollbar hiding script inside of the parent popup, the scrollbars appear.

There must be another way, but this has solved the problem.

Now however, I want to replace 'page2.html' with a variable, but can't seem to get it working. The getURL works with the variable without javascript, so I'm guessing that I got my syntax wrong.

I've tried:

_root.link2

'_
root.link2'

"_root.link2"

but they don't work.

Any idea what I'm doing wrong?
×

Success!

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