software:html
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
software:html [2022/09/07 17:10] – removed - external edit (Unknown date) 127.0.0.1 | software:html [2022/09/07 17:10] (current) – ↷ Page moved from interestinginfo:html to software:html superwizard | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Frameset Referencing ====== | ||
+ | http:// | ||
+ | |||
+ | ====== FORCE MANY PAGES INTO frames ====== | ||
+ | http:// | ||
+ | <pre> | ||
+ | With search engines now indexing framed pages, lots of traffic is being sent straight to pure content pages, orphaned from their parent frameset. Building a separate frameset for each possible content page is one solution, but it can be a maintenance nightmare. This script handles the problem. | ||
+ | |||
+ | THE MAIN IDEA | ||
+ | You can add ANY page's name to the end of a URL [after a "?" | ||
+ | |||
+ | THE CODE | ||
+ | Call this javascript code from the HEAD section of each child page. The code creates a variable from the URL of the page, and then passes that variable in the new location' | ||
+ | |||
+ | passpage = document.URL | ||
+ | if (top.location == self.location) | ||
+ | top.location.href=" | ||
+ | |||
+ | Then create just one " | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | <script language=" | ||
+ | |||
+ | origURL = parent.document.URL | ||
+ | contentURL = origURL.substring(origURL.indexOf('?' | ||
+ | |||
+ | document.write('< | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <pre> | ||
+ | THE BACK BUTTON | ||
+ | With the basic code above, if someone comes to your page from a search engine, the redirect will place two pages in the browser' | ||
+ | |||
+ | But if you use the replace() method instead of simply reassigning the url, the Back Button issue is addressed. Only one page is placed in the browser history instead of two. | ||
+ | |||
+ | passpage = document.URL | ||
+ | if (top.location == self.location) | ||
+ | top.location.href=" | ||
+ | |||
+ | Becomes: | ||
+ | passpage = document.URL | ||
+ | if (top.location == self.location) | ||
+ | location.replace(" | ||
+ | </ |