|
-
Help anyone,
What i am trying to do is control the frames in the browser windows. The Problem is with MS keywords, when you access a site via this method your site is displayed but in a bottom frame. The top frame contains a banner from MicroSoft advertising the keyword service. What I want to do is allow the bottom frame with the site to be displayed but to disregard the top frame. Now can you do this by changing the parameters of the top frame or do you have to redirect to a completely different page?
I know I havn't explained myself very well but I think my question is this: Can you control a top frame from Javascript inserted in the bottom frame and if so how?
PPPPPlease help, quite urgent
Richthe ex marine
-
Sure you can - frames are just part of the document object model (DOM).
from the bottom frame:
Code:
top.top_frame_name.location.href='some_other_page.html'
that will change the URL of the top frame.
However, if the top frame is http://somedomain.com and the bottom frame is http://someotherdomain.com you cannot communicate between frames as I just demonstrated.
-
you can put this in the head of your page:
<script language="JavaScript">
<!-- //hide from old browsers
if (self != top) top.location.href = window.location.href;
//-->
</script>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|