Click to See Complete Forum and Search --> : loading page in preexisting window
patrik
03-04-2003, 04:50 PM
Looking for a simple way to load link to another page and have the target be a different, already pre-existing 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 different 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!
PeOfEo
03-04-2003, 05:18 PM
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.
patrik
03-04-2003, 05:28 PM
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 (B).
2) new window (B) - 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 (B) to close itself at the same time
Make more sense?
PeOfEo
03-04-2003, 05:45 PM
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.
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>
patrik
03-04-2003, 06:44 PM
pyro wrote:
Try coding your popup page something like this...
Beautiful - this works great!
One last thing -
Is there anyway to append a onClick="self.close()" to this so the pop-up will close itself as the other page loads?
Thanks again!
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>
patrik
03-04-2003, 07:01 PM
Ah, yes. Forgot you wanted that....
Wow - that was fast!
Again, that works beautifully!
Thanks for making my day!