/    Sign up×
Community /Pin to ProfileBookmark

loading page in preexisting window

Looking for a simple way to load link to another page and have the target be a different, [i]already pre-existing[/i] window.

I know it’s trivial to simply open a new window or to target a frame in the same window, but I wish to use a [i]different[/i] window that I know will already be open. One other thing; can the originating window be made to close itself at the same time?

TIA!

to post a comment
HTML

7 Comments(s)

Copy linkTweet thisAlerts:
@PeOfEoMar 04.2003 — Your going to do what with the what? Ok you want a spalsh screen like a loding page right? Then you want your main page to open in a new window and the spalsh screen to close its self right? Or am I not even in the ball park of understanding what you are asking.
Copy linkTweet thisAlerts:
@patrikauthorMar 04.2003 — Sorry if I haven't explained well!

Here's the deal:

1) from homepage (A), user clicks link and gets small, new pop-up window (?.

2) new window (? - apart from its content - has link to different part of the site, which I'd like to open in the window in which the homepage currently resides (A).

3) ideally, I'd also like the new window (? to close itself at the same time

Make more sense?
Copy linkTweet thisAlerts:
@PeOfEoMar 04.2003 — Yea. You are going to need a way to communicate between your windows. Its going to involve java script and its going to be pretty complex. I am thinking it will be a lot like communicationg between frames, but I dont know exactly how you are going to do what you want to exactly. This will be pretty tough to do, I am drawing blanks. Why dont you post this over in the java script forum. It is defianty possible with php because I have seen things where it puts data in a text box from anoherwindow but I just can;t think of how to do it client side.
Copy linkTweet thisAlerts:
@pyroMar 04.2003 — You are going to need some javascript to do this. Try coding your popup page something like this...

<html>
<head>
<script language="javascript" type="text/javascript">
function openpage(ref)
{
window.opener.location = ref;
}
</script>
</head>
<body>
Your Content Here.
<a href="yourpage.htm" onClick="openpage(this.href); return false;">Open page in main window</a>
</body>
</html>
Copy linkTweet thisAlerts:
@patrikauthorMar 04.2003 — pyro wrote:

[i]Try coding your popup page something like this...[/i]

Beautiful - this works great!

One last thing -

Is there anyway to append a [b]onClick="self.close()"[/b] to this so the pop-up will close itself as the other page loads?

Thanks again!
Copy linkTweet thisAlerts:
@pyroMar 04.2003 — Ah, yes. Forgot you wanted that....

<html>
<head>
<script language="javascript" type="text/javascript">
function openpage(ref)
{
window.opener.location = ref;
window.close();
}
</script>
</head>
<body>
Your Content Here.
<a href="yourpage.htm" onClick="openpage(this.href); return false;">Open page in main window</a>
</body>
</html>
Copy linkTweet thisAlerts:
@patrikauthorMar 05.2003 — [i]Ah, yes. Forgot you wanted that.... [/i]

Wow - that was fast!

Again, that works beautifully!

Thanks for making my day!
×

Success!

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