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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing frame contents

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
What is wrong with this code? If the page is not in the framelink called main, I need to change the contents of lefttop, leftmiddle, and leftbottom. The self page can stay put.

<script language=javascript type=&quot;text/javascript&quot;>
<!-- Hide script from old browsers
// jump out of any framesets
if (self.location != main) {
lefttop.location.href = &quot;centermiddle.html&quot;
leftmiddle.location.href = &quot;centermiddle.html&quot;
leftbottom.location.href = &quot;centermiddle.html&quot;
}
// end hiding from old browsers -->
</script>
 
If the name of the window is actually &quot;main&quot;, you should be enclosing main in quotes, otherwise the interpreter thinks you're referring to a variable called main:

if (self.location != &quot;main&quot;) {
lefttop.location.href = &quot;centermiddle.html&quot;
leftmiddle.location.href = &quot;centermiddle.html&quot;
leftbottom.location.href = &quot;centermiddle.html&quot;
}
// end hiding from old browsers -->
</script>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top