Ho trovato su di un sito uno script che dovrebbe fare al caso mio, ma non capisco il suo funzionamento:
http://www.hotscripts.com/Detailed/10889.html
posto il codice che indicano:
per l'index:
codice:
<script>
/*
---------------------------------------------------------------------------
LINK DIRECTLY TO A PAGE IN FRAME OF FRAMESET
---------------------------------------------------------------------------
Version: 1.1
Date: 06-04-2003
Author: Jurjen van de Pol (vandepol-at-gmx-net)
Download URL: http://www.xs4all.nl/~illegaal/vande...oframe_v11.zip
Disclaimer: No warranty of any kind comes with this script.
Copyright: Feel free to adjust or redistribute this code.
Please include this copyright notice.
---------------------------------------------------------------------------
- Use "frameset.html?page=file" to specify which page is to be loaded
in the specified frame of the frameset, specify the frame below remark 3.
Example: frameset.html?page=welcome
- The ".html" extension will be added by the script. This can be changed in
php, asp, etc. Just lookup the following code: SRC='" +page + ".html'
and change ".html" in the extension of your choice.
- Make sure to use the special "body onload" tag in all of your frame pages,
see the enclosed example frame pages information.html and welcome.html.
- Note: be sure to put all frameset variables between quotation marks ''
otherwise your page will generate errors. Copy-paste with care!
---------------------------------------------------------------------------
*/
ref = location.href;
// 1. See if there is anything called (? or &)page=somepage_nr1
// within the string
pageRE = /(\?|\&)page=(\w|,)*/;
pageStr = ref.match(pageRE);
// 2. Set the default page to be shown in the frame when the frameset is
// loaded without parameters (like example: frameset.html)
page = "welcome";
if(pageStr != null) {
// remove the (? or &)page= part of the string
page = pageStr[0].substring(6, pageStr[0].length);
// change all comma's back to slashes
page.replace("/,/", "/\//");
}
document.write("<frameset rows='80,*' frameborder=YES border='1' framespacing='0'>");
document.write(" <frame name='Topframe' scrolling=NO noresize src='navigation.html' >");
// 3. Below is the description of the frame where the page specified by the
// parameter "?page=..." is to be loaded in.
document.write("<FRAME NAME='Mainframe' SRC='" +
page + ".html' SCROLLING=AUTO NORESIZE FRAMEBORDER='0'>");
document.write("</FRAMESET><noframes>Put your no-frames content here (description + keywords), some search engine spiders cna't read frames en will only read this</noframes>");
</script>
e per le pagine:
codice:
<body OnLoad="if(parent.frames.length==0)top.location='frameset.html?page=information';">
io ho due frame:
menu.html (name sinistra)
corpo.html (name destra)
quelle sono richiamate direttamente dall'index, in seguito con il menu di sinistra si richiamano le altre pagine che si aprono nel frame di destra.
I frame li devo usare perche ho scropt sia sul menu che nelle altre pagine dedicate alla navigazione, se li metto tutti in una pagina si bloccano e quindi sono "fregato"...
Il frame descritto nell'articolo è diverso dal mio, ma comunque penso si possa adattare, posto il mio index.html:
codice:
<FRAMESET framespacing="0" frameborder="0" border="false" COLS="180,*">
<FRAME name="sinistra" noresize SRC="menu.html" SCROLLING=no MARGINWIDTH=0 MARGINHEIGHT=0>
<FRAMESET framespacing="0" frameborder="0" border="false" ROWS="*">
<FRAME name="destra" noresize SRC="corpo.html" SCROLLING=auto MARGINWIDTH=0 MARGINHEIGHT=0>
</FRAMESET>
<noframes>
<body>
Questa pagina é fatta con i frames ma il tuo browser non li supporta.</p>
Se questo succede, Ti prego di contattarmi via email</p>
Webmaster</p>
</body>
</noframes>
</frameset>
Grazie a tutti e Buon Anno 2007