Pour les personnes qui travaillent encore avec des Frames (beurk), il peut être intéressant d'avoir une astuce simple pour s'assurer que certaines pages ne sont pas chargées en dehors des frames...
Voici du Javascript qui peut aider :
1) dans les pages qui sont chargées par les frames et qui sont donc susceptibles d'être référencées par GOOGLE et donc chargées en dehors des frames, ajouter ceci :
[...]
<head>
[...]
<script language="JavaScript">
if (parent.frames.length < 1)
{
chaine="http://www.monsiteweb.com/accueil.htm?from="+document.location.href
document.location.href = chaine;
}
</script>
</head>
Evidemment, dans l'exemple ci-dessus il faut remplacer monsiteweb.com par votre site et accueil.htm correspond à la page contenant le FRAMESET
2) Dans la page définissant les Frames (contenant le Frameset), il faut ajouter (dans notre exemple dans accueil.htm donc) :
<html>
<head>
[...]
<script>
function goodurl()
{
chaine=document.location.href
if (chaine.indexOf("from=")>-1)
{
parent.principal.location.href=chaine.substring(chaine.indexOf("from=")+5,chaine.length)
}
else
{
parent.principal.location.href=http://www.monsiteweb.com/cadre_principal.htm
}
}
</script>
</head>
<frameset rows="107,*,20" framespacing="0" border="0" frameborder="0" onLoad="goodurl();">
<frame name="haut" scrolling="no" noresize marginheight="0" src="cadre_haut.htm" target="principal" marginwidth="0" style="border-left-width: 1; border-right-width: 1; ">
<frame name="principal" scrolling="auto" noresize src="cadre_principal.htm" target="_self" style="padding: 0">
<frame name="bas" scrolling="no" noresize src="cadre_bas.htm" target="principal" marginheight="0" marginwidth="0" style="border-left-width: 1; border-right-width: 1; border-bottom-width: 1">
<noframes>
<body style="border:0px solid #FFCC00; " text="#000000" bgcolor="#0000FF">
<p>Bienvenue sur MON SITE WEB. Malheureusement votre navigateur Internet n'accepte pas les frames...</p>
</body>
</noframes>
</frameset>