View Full Version : check for MY frameset
BroChris
02-12-2003, 03:08 PM
I want to check the document's frameset, and add my frameset if it is not already present. I have code that works to check if there is a frameset present, but it could be any frameset. How do I make sure the page has MY frameset, and not any other?
justame
02-12-2003, 03:21 PM
bro...
/me just a has® this copied/pasted/saved n' credited from...
JohnKrutsch Moderator posted 10-17-2000 02:25 PM
How about setting a variable in the frameset document then checking to see if it exisits
on the subpages:
On the frameset page:
<SCRIPT>
keepFrame=1
</SCRIPT>
Then on the suppages:
<SCRIPT>
<!--//
if(self.location==top.location){
//Go to your frameset page
location="yourPage.htm"
}
if(self.location!=top.location && !top.window.keepFrame){
//Go to your frameset page
location="yourPage.htm"
}
//-->
</SCRIPT>
just a goodluck® n' hoping it helps...:O)))
BroChris
02-12-2003, 07:30 PM
I think I'm still missing something.
If a person is trapped in someone else's frames, that code won't work (they are in someone's frames, just not MY frames). How can I check to make sure they are in MY frameset?
I want to write something like:
if(top.location.indexOf!=("http://www.chrisandabby.com/chris/test/main.html?"))
{top.location="main.html?page=services_backgrounds"};
But I can't get it to work. Maybe I just have no idea what I'm doing.
justame
02-12-2003, 08:07 PM
bro...
/me just a has® faith/respect for johns coding...n' /me thinks that thisss line...
if(self.location!=top.location && !top.window.keepFrame)
will make sure its yourrr just a frameset® since yourrr main page that holds the frameset woullld have the...
<SCRIPT>
keepFrame=1
</SCRIPT>
in it...vs some just a other® frameset wouldnt...:O)))
n' /me doesnt reallly just a understand® alll this stuff either...sooo /me leaves it to the 'pros' to help /me out...hehehe...
BroChris
02-12-2003, 09:15 PM
Could you give me a link to the post the you are reffering to? I can' t get it to work.
Got it to work, nevermind :) Thanks for your help.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.