Question about frames
This is a somewhat complicated question to describe, so please bear with me...
Here is the scenario:
Let's say I have a small popup window launched off of our home page, and that popup has on it a link to another page of our's on an entirely different website. For the sake of my example, I'll call this new link: http://www.remotepage.com/index.html
On the first site I also have a (full size) page set up with frames - framepage.html. This page has two frameset rows, called:
and
So a person comes to the homepage and clicks the link that launches the small popup; they then click the link on the popup that will open the remote site http://www.remotepage.com/index.html.
Question: Is it possible to have this remotepage.com/index.html page load (after being launched from the small popup) into the *bottom part only* of my framepage.html?
** Home page > popup > http://www.remotepage.com/index.html > bottom part only of framepage.html **
I have tried a number of different configurations on the popup link, which did not work, such as:
...and...
Any suggestions would be much appreciated....
Thanks,
Reno
Jack Michaelson posted this at 19:44 — 1st March 2002.
He has: 1,733 posts
Joined: Dec 1999
<a href="http://www.remotepage.com/index.html" target="bottom">Remote page</a>
'...should do it.
[edit] no, wait. that shouldn't do it. Figuring it out right now I'll post it when I have it [/edit]
Shakespeare: onclick || !(onclick)
Jack Michaelson posted this at 20:03 — 1st March 2002.
He has: 1,733 posts
Joined: Dec 1999
This is the code that has to be placed in the popup window:
<html>
<head>
<title>Untitled</title>
<script language="javascript">
function changebottom()
{
opener.location.replace('bottom2.html');
}
</script>
</head>
<body bgcolor="silver">
<a href="javascript: changebottom();">click here to change bottom</a>
</body>
</html>
where 'java script' has to be entered like 'javascript'. Those little forum-bugs!
Anyway: is that it?
Shakespeare: onclick || !(onclick)
Suzanne posted this at 22:06 — 1st March 2002.
She has: 5,507 posts
Joined: Feb 2000
that's not a bug, that's a feature. ha ha.
actually, the "javascript" = "java script" is to prevent hacking, I believe.
SW Reynolds posted this at 23:54 — 1st March 2002.
They have: 24 posts
Joined: Dec 2001
Hello Jack,
It was very kind of you to send your suggestion - thank you. I was hoping for a non-js answer to this, as the situation I am attempting to figure out already has the in a jscript.
I was trying to keep my original post as short as possible, but if the solution will involve js, then I need to be more detailed.
Everything I said in the first post was accurate, but the reality is more complicated. What I have at the top of the small popup is a js that randomly presents a banner. That banner is of course hyperlinked to an external site. There are 3 url's in the random list.
As the first banner is presented at the top of the small popup, I'd like to have the site it references load in the bottom of the frame page if that banner was clicked. If the viewer ignores the first banner but clicks the second, then that second page would load in the bottom of the frame page. I do not know how to write js, so am at a loss how to incorporate your suggestion into an existing script.
Here are the details: the frame page sits in a folder called "framepage". In that folder are 3 files: framepageindex.html (parent); frametop.html and framebottom.html.
I want the externally located banner page address to open up in the framebottom.html part of the parent (framepageindex.html).
For your info, here is the current random load banner script... this is placed in the body, where the banner loads (this is the entire script - nothing is placed in the head).
Note that I have consistently substituted [ + ] for < + >:
========================================
[SCRIPT LANGUAGE="Javascript">
[!--
// ********************************
// AUTHOR: CGISCRIPT.NET, LLC
// URL: http://www.cgiscript.net
// Use the script, just leave this message intact.
// Download your FREE CGI/Perl Scripts today!
// ( http://www.cgiscript.net/scripts.htm )
// ***********************************************
function banner() {
};
banner = new banner();
number = 0;
// bannerArray
banner[number++] = ""
banner[number++] = ""
banner[number++] = ""
// keep adding items here...
increment = Math.floor(Math.random() * number);
document.write(banner[increment]);
//--></script]
========================================
So if I place your script in the head:
========================================
[script language="javascript">
function changebottom()
{
opener.location.replace('framepage/framebottom.html');
}
</script]
========================================
How then do I incorporate the second part of your suggestion
========================================
[a href="javascript: changebottom();"]
========================================
into this part of the original rotating banner script?:
========================================
banner[number++] = ""
========================================
Would it look something like this??
========================================
[a javascript: 'changebottom();' href='http://www.remotetestpage1.com/']
========================================
I warned you that it was complicated!
Thanks for your insight....
Reno
Jack Michaelson posted this at 10:03 — 4th March 2002.
He has: 1,733 posts
Joined: Dec 1999
Sorry for the wait, but I was given the change to make a few steps in the 'real world' last weekend
Anyway:
I runned your script and, because the function calls itself, it ends up in a memory overflow --> IE5 crash. I didn't have time to figure the rest out, but I will tonight. I'll post it then.
Shakespeare: onclick || !(onclick)
Jack Michaelson posted this at 18:36 — 4th March 2002.
He has: 1,733 posts
Joined: Dec 1999
Hi,
Took a while but I think this is what you want.
Loose the old script and place this in the head section of your bottompage:
<script language="javascript">
function openup(url)
{
var locationStr1="http://www.remotetestpage1.com"
var locationStr2="http://www.remotetestpage2.com"
var locationStr3="http://www.remotetestpage3.com"
//add more if you like
img=new Array()
img[1]="<a href=javascript:opener.location.replace('"+locationStr1+"')><img src='banner1.gif' border='0'></a>";
img[2]="<a href=javascript:opener.location.replace('"+locationStr2+"')><img src='banner2.gif' border='0'></a>";
img[3]="<a href=javascript:opener.location.replace('"+locationStr3+"')><img src='banner3.gif' border='0'></a>";
//add more if you like
//Opening the popup
var bannerImage=img[randomize(img.length-1)];
win= open(url,'popup','width=800,height=100,status=yes,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no,directories=no');
win.document.open();
win.document.write(bannerImage);
win.document.close();
}
//random banner
function randomize(number)
{
return (Math.floor(Math.random()*number)+1);
}
</script>
and place this in the bodysection of your bottompage:
<a href="javascript: openup('popup.html');">click here to open popup</a>
Make a file called 'popup.html' and leave it empty. This is the placeholder where the banner will appear.
Hope this is it
Shakespeare: onclick || !(onclick)
SW Reynolds posted this at 17:20 — 5th March 2002.
They have: 24 posts
Joined: Dec 2001
Hi Jack,
Thanks for checking back about this question I raised - hope the "real world" was good to you!
Thanks too for working out this script. I admire your ability to write javascript. If I understand your script correctly, it will launch a popup *out of* the bottom page of a frame. What we want to do is to load an external url address (from the popup) *into* the bottom part of a pre-existing frame page.
To show you what I mean, I've placed a page online. This page has a link that leads to the popup, which has the banner ad. On that popup is a link to the type of frame page interface that we'd like to use.
You can see this first page at:
http://www.electroniccottage.com/test/test_index.html
My original hope was that there was a reasonably simple way to direct the external page into the bottom of the frame, using html if possible, and failing that, then a javascript. It seems that js is going to be the approach, if this is do-able at all.
I very much appreciate you looking at this. There is no gigantic hurry, so only devote as much time as you feel is reasonable. If we can work this out, then possibly the script would be useful to other people who would like randomly loaded banners on their sites to open in one of their own frame pages. It seems like it would be a way to utilize banners without losing visitors.
If you'd ever like to email me directly, you can do so at the mailto that I have on the test_index.html page referenced above....
Best wishes,
Steve Reynolds
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.