SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: ensuring content is in frames
-
Sep 22, 2002, 07:46 #1
- Join Date
- Feb 2000
- Location
- England
- Posts
- 568
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
ensuring content is in frames
I want to make sure that a page is loaded inside its frameset. This is easy enough if you don't mind just reloading the frameset just using:
if (window == top) top.location.href = "frames.html";
However what I want is the page i am loading to be loaded in the content frame (where it should be). Anyone with any suggestions?
-
Sep 22, 2002, 08:47 #2
- Join Date
- Mar 2002
- Location
- Svíþjóð
- Posts
- 4,080
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
if (window == top)
{
top.location.href = 'frame.php?page=' + escape(location.href.substring(location.href.lastIndexOf('/') + 1));
}
See this thread
-
Sep 22, 2002, 10:39 #3
- Join Date
- Feb 2000
- Location
- England
- Posts
- 568
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Oh brilliant! Thanks so much.
-
Sep 24, 2002, 15:33 #4
- Join Date
- Sep 2002
- Location
- Bournemouth, South UK
- Posts
- 1,551
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
I use this method in HEAD
I use this method in the <head> page of the html.
I haven't tried it in an external .js file yet though.
<script language="javascript" type="text/javascript">
if (top.location.href.indexOf("index.html") == -1)
top.location.href = "index.html?sales.html&2";
</script>
where index.html is the page that calls the frames, and sales.html is the page visited and '2' being the index of the frame.
I use;
<SCRIPT LANGUAGE="JavaScript">
<!--
if (top.location !=self.location) {
top.location.replace(self.location)}
var ar0 = "banner.html";
var ar1 = "menu.html";
var ar2 = "main.html";
var str = location.search;
var pos = str.indexOf("&");
if (pos != -1) {
var num = str.substring(pos + 1, str.length);
window["ar" + num] = str.substring(1, pos);
}
// -->
</SCRIPT>
Bookmarks