Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2978 connectés 

  FORUM HardWare.fr
  Programmation
  HTML/CSS

  Problème avec une iframe

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Problème avec une iframe

n°853937
ddr555
Posté le 20-09-2004 à 10:48:51  profilanswer
 

Bonjour,
 
j'ai un écran de recherche dans lequel j'ai deux iframe, en fonction du click dans la première iframe, je voudrais changer le contenu affiché dans la deuxième, mais voilà je ne sais pas comment faire ça, je n'ai que le contrôle de ce qui est affiché dans ma première iframe

mood
Publicité
Posté le 20-09-2004 à 10:48:51  profilanswer
 

n°853948
pc75
Posté le 20-09-2004 à 11:08:51  profilanswer
 

Bonjour,
 
Cet exemple devrait pouvoir t'aider :
 
Fichier Default.htm
"""""""""""""""""""
<html>
<head>
<title>Exemple</title>
</head>
 <frameset rows="60,*">
<frame name="menu_haut" src="frame_du_haut.htm" marginwidth="0" marginheight="0" noresize scrolling="no" >
  <frameset cols="145,*" >
<frame name="menu" src="menu.htm" marginwidth="0" marginheight="0" noresize scrolling="Auto">
 <frame name="princ" src="frame_du_bas.htm" marginwidth="5" marginheight="5" scrolling="Auto">
 </frameset></frameset>
</html>
 
Fichier frame_du_bas.htm
""""""""""""""""""""""""
<html>
<head>
<title>Frame du haut</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script>
function afich_titr2() {
chj=parent.frames[0].location.href  
it=chj.indexOf("frame" );
chjl=chj.length
if ((chj.substring(it,chjl)) !="frame_du_haut.htm" ){
parent.frames[0].document.close()
parent.frames[0].location.href="frame_du_haut.htm"}}
</script>
<body bgcolor="#FFFFFF" onload="afich_titr2()">
<p align="center"><font color="#0000A0"><big><big> Frame du bas</big></big></font></p>
</body>
</html>
 
Fichier frame_du_bas2.htm
"""""""""""""""""""""""""
<html>
<head>
<title>Frame du haut</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script>
function afich_titr2() {
chj=parent.frames[0].location.href  
it=chj.indexOf("frame" );
chjl=chj.length
if ((chj.substring(it,chjl)) !="frame_du_haut2.htm" ){
parent.frames[0].document.close()
parent.frames[0].location.href="frame_du_haut2.htm"}}
</script>
<body bgcolor="#FFFFFF" onload="afich_titr2()">
<p align="center"><font color="#000000"><big><big>&nbsp; Nouvelle frame du bas</big></big></font></p>
<p align="center"><a href="frame_du_bas.htm"><font color="#0000FF"><big>Retour frame
précédente</big></font></a></p>
</body>
</html>
 
Fichier frame_du_haut.htm
"""""""""""""""""""""""""
<html>
<head>
<title>Frame du haut</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p align="center"><big><big>Frame du haut</big></big></p>
</body>
</html>
 
Fichier frame_du_haut2.htm
""""""""""""""""""""""""""
<html>
<head>
<title>Frame du haut</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p align="center"><font color="#FF0000"><big><big> Nouvelle frame du haut</big></big></font></p>
</body>
</html>
 
Fichier menu.htm
""""""""""""""""
<html>
<head>
<title>Frame du haut</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p align="center"><font color="#000000"><big><big>&nbsp; Menu</big></big></font></p>
<p align="center"><a href="frame_du_bas2.htm" target="princ"><big><font color="#0000FF">Cliquez
ici</font></big></a></p>
<p align="center"><a href="default.htm" target="_top"><big><font color="#0000FF">Retour</font></big></a></p>
</body>
</html>

n°853950
ddr555
Posté le 20-09-2004 à 11:13:58  profilanswer
 

faut voir si ça marche pareil entre iframe et frame ;)
 
je regarde

n°853979
Leris
Posté le 20-09-2004 à 11:47:09  profilanswer
 

salut,
 
suffit de mettre dans le lien : target="name_iframe2"
 
++
 
L.

n°854127
ddr555
Posté le 20-09-2004 à 14:50:16  profilanswer
 

ok, merci ;)

n°854131
ddr555
Posté le 20-09-2004 à 14:59:09  profilanswer
 

Leris a écrit :

salut,
 
suffit de mettre dans le lien : target="name_iframe2"
 
++
 
L.

tu peux me donner un exemple précis d'url ?

n°854828
ddr555
Posté le 21-09-2004 à 13:58:47  profilanswer
 

c'est quoi le code si je veux directement effectuer ceci sans faire un lien <a>
 
c'est à dire éxécuter directement le changement d'une page asp lors de son exécution ( là c'est le click qui déclenche l'action )

n°855344
Leris
Posté le 21-09-2004 à 23:08:43  profilanswer
 

re,
 
exemples d'url :
l'iframe 2 a pour "name" : ifr2
 
<a href="page01.htm" target="ifr2">vazidon</a>
 
<a href="#" onclick="parent.frames.ifr2.location.href='page01.htm';return false;">reziva</a>
 
++
 
L.


Message édité par Leris le 21-09-2004 à 23:09:23

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  HTML/CSS

  Problème avec une iframe

 

Sujets relatifs
delphi :ShellExecute probleme pour parametre[background-image] Problème d'inclusion d'image (chemin)
[résolu] problème avec iframe[Newbie] Problême d'iframe
Problème de taille de la barre de défilement sur iframe[Résolu][JavaScript]Probleme de Iframe + refresh
probleme de redimensionnement d'une IFRAMEProbleme d'affichage d'une video dans une iframe
problème d'iframe sous opera...HTML - P'tit probleme de TAG (IFRAME Pour netscape ?)
Plus de sujets relatifs à : Problème avec une iframe


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR