voir la source Want to make sure that visitors are viewing your site inside of the frames they are supposed to be? Confused? Follow this example: Pretend you have these three html files... frameset.html - This defines your frames. menu.html - The file to be displayed in your menu frame. main.html - The file to be displayed as your main part of the frameset. If someone really likes the info on your page main.html, they might link directly to this page. Search engines often do this also. The problem is that the frameset.html and menu.html will not be loaded, thus possibly 'damaging' your navigation system to the end user. You can use a JavaScript to check to see if the page you are using is being viewed inside a frame. Here is the code that can be placed in the
... of your menu.html, main.html, and frameset.html files: To test the script, simply visit the main.html page. Your browser will detect that the page is not in a frame and will automatically load the frameset.html file and thus load all of your frames, including the menu.html file. NOTE: This script will also break out of any other frames the visitor might already be in. In other words, your frameset will always be loaded on top (like the Don't Get Framed script). There is a slight problem with this. If you have many pages (like main.html, main1.html, main2.html, main3.html, main4.html...) and include this script on all of them, when the frameset is loaded, it will NOT remember what page you came from. So if you visit main2.html (and it is not in a frame and it has this script on it) it will automatically load frameset.html which will call up menu.html and main.html, NOT the main2.html file where the visitor originated. Therefore, your visitors will have to look around for the page. ou vu dans la source de la cnil