Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get frame name

Status
Not open for further replies.

mrdance

Programmer
Apr 17, 2001
308
SE
I have a frameset with two frames. The names of them are "topframe" and "bottomframe". I want to check if the frameset "exists" by trying to get the frame name of the "topframe". I am preparing for searchengines, and if only the "bottomframe" opens I want to redirect to the frame index so that the whole page will be shown. I have tried this but it doesn't work:

<SCRIPT>
if (window.location.target!=&quot;topframe&quot;)
{
-> redirect to page
}
</SCRIPT>

Any ideas?

Thanks / Henrik

 
Have you tried this:
Code:
if ( top.location == self.location ) {
   redirect
}
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
another way:

if (top.length){
//redirect
}

works in ie, don't know about others (didn't checked yet..) Victor
 
thanks you, but I found this solution as well;

<script>
if(parent.self.location != 'file:///C:/temp/index.html'){
top.location = &quot;index.html&quot;;
}
</script>

// Henrik
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top