| JavaScript Document (8) Events (8) ExtJS (7) Strings (3) |
Force a page to always appear in a FRAMESET
Question: Our site uses a horizontal frame at the top for navigation. So even if people visited my page through a direct link e.g. from the search engine Google, I want the page to appear in that frameset. How should I do this?Answer: You check to find out that a page is not framed and then you load the desired frameset:if (top == window) top.location.href = 'frameset.html'; You can even pass the frame url in the query string e.g. if (top == window) top.location.href = 'frameset.html?' + escape(window.location.href); This line has to be in every to-be-framed document on your site. Then in the main frame page - let's call it frameset.html - you read the query string to get the frame url and afterwards you document.write the frameset. The example below shows how such a Frameset.html file would look like.
Comments:
|