OVH Cloud OVH Cloud

Comment Bloquer un redirect ?

1 réponse
Avatar
Chris
Bonjour,

J'ai la question suivante:

J'ai 2 pages web

page1.html : comportant le code javascript suivant:
....
<SCRIPT LANGUAGE="JavaScript">
if (top.frames.length!=0) top.location=self.document.location;
</SCRIPT>
....


Dans la seconde page j'ai un iframe sur la 1ere:

Page2.html:
....
<iframe width="50%" src="page1.html">
....

page2.html est redirigé vers page1.html due au javascript inclue dans
page1.html.

Ma question :
Est il possible de bloquer le redirect vers "page2.html" dans page1.html ?

Merci beaucoup pour votre aide,
Chris.

1 réponse

Avatar
ASM
J'ai 2 pages web

page1.html : comportant le code javascript suivant:
....
<SCRIPT LANGUAGE="JavaScript">
if (top.frames.length!=0) top.location=self.document.location;
</SCRIPT>


qui est le code bateau pour sortir des frames non désirées

Dans la seconde page j'ai un iframe sur la 1ere:

Page2.html:
....
<iframe width="50%" src="page1.html">
....

page2.html est redirigé vers page1.html due au javascript inclue dans
page1.html.

Ma question :
Est il possible de bloquer le redirect vers "page2.html" dans page1.html ?


Page 1 :
<iframe name="scoubidoutsointsoin" ...

Page 2 :
<SCRIPT type="text/JavaScript">
if (top.frames.length!=0 &&
typeof(top.scoubidoutsointsoin) == 'undefined')
top.location=self.location;
</SCRIPT>


--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé