Well, I think I'm going to need clarification of said script. For example, my frame's name on the index.html is 'sara'. One of my pages is named 'foreclosure.php'...Now...to get foreclosure.php inside 'sara' on the index.html
An example would be great...
Thanks
__________________ Zoobie or not Zoobie...That is the problem. <body onUnload="flush( ! )">
okay, change that line in the second piece from
document.frames.main.src = newFrameSrc[1];
to
document.frames.sara.src = newFrameSrc[1];
and paste the first bit of code into foreclosure.php (or create a new file and <script src> it.
What's happening here is that from the first snippet, the script says, "If I'm the top frame, better put me inside the frameset. Plus, I'll have to tell the frameset who I am, so the frameset can find me." The location.path property contains anything after the .com/ in your URL. Appending it on to the URL in the query string (what follows the ?) creates a value to be held in the index.htm's location.search property, which is where the next piece of script comes in.
Name-value pairs in a query string are separated by ampersands (and sometimes question marks find their ways in there), so what we want to do here is create an array (using .split()) out of this location.search variable, and claim its first member (index 0, [0] )as our variable. What we've got in that variable is now pg=foreclosure.php - we then split() it again based on the equals sign we see, which turns it into an array containing ["pg", "foreclosure.php"] as its contents. The page name is at index 1, so that's what we want to change the frame's source to.
1. index.html - this is the frameset and has an iframe called 'sara'. Includes a js function.
2. foreclosure.php - framed page with a js function to load it into index.html
This works for me, so have a look at it and change it around if you need to. Hope it works
Cheers...
__________________
"Computers are considered female - As soon as you make a commitment to one, you find yourself spending half your paycheck on accessories for it."
Nope...Still not working...I'm testing on the net now...but even with that simple version, all I get is a blank white page...Yep...I added the onload events, too.
Part 1 in frame page(s)
<script>
<!--
function LoadFrame(){
if (parent == self) window.location.href = "index.html?foreclosure.php";
}
//-->
</script>
</head>
<body onload="LoadFrame();">
Part 2 in index.html
<script>
<!--
function setFrame() {
if(location.search) {
window.sara.location = location.search.substring(1);
}
}
//-->
</script>
</head>
<body onload="setFrame();">
zoobie, not sure, I tested what I did only my server and it worked. Perhaps you could supply the exact www address and I will have a look at that. Maybe worth a try I guess?
__________________
"Computers are considered female - As soon as you make a commitment to one, you find yourself spending half your paycheck on accessories for it."
Well, it's working locally in the same folder...but not on the web. Do I need to need to use a full URL like:
if (parent == self) window.location.href = "www.site.com/index.html?foreclosure.php";
?
__________________ Zoobie or not Zoobie...That is the problem. <body onUnload="flush( ! )">
I guess if all your files are in the same folder location then you can use, if (parent == self) window.location.href = "index.html?foreclosure.php";
but if the files are in different folder locations then you would need to specifiy the folder location and the filename, e.g.
if (parent == self) window.location.href = "http://www.site.com/index.html?foreclosure.php";
Give it a go, see if it works.
__________________
"Computers are considered female - As soon as you make a commitment to one, you find yourself spending half your paycheck on accessories for it."
Ok...I finally got it to work...Thanks. I wasn't waiting for both pages to fully load. I made a faster way...
This doesn't allow the first page to load:
if (parent == self) location.replace("index.html?foreclosure.php");
Now, if we could just get the index to load this page into the frame immediately instead of waiting for the whole index to load, it would be faster yet...