Forum de discussion
Forum « Programmation Javascript » (archives)
Erreur sous Netscape et pas sous IE
Envoyé: 2 mars 2004, 3h04 par simsas
Rechercher(voir ci dessous <!-- RECHERCHE --> dans left.asp)
Sous ie 6 cela fonctionne très bien.
Sous netscape pas du tout
Error: parent.parent.frames.topFrame.Layer2 has no properties
Source File: http://antares/enot/cat_tools/actveakt/content_2/left.asp
Line: 43
Error: top.BottomFrame.leftFrame.LISTE has no properties
Source File: http://antares/enot/cat_tools/actveakt/content_2/top.asp
Line: 119
J'ai l'impression que ce code fonctionne sous ie 6 car celui-ci fait
des racourcis que Netscape n'autorise pas.
Si quelqu'un peut m'aider, je lui en serais très reconnaissant.
Alex.
Voir code ci-dessous.
################################################################################
Voici le code de ma page de départ: frame.asp
################################################################################
<html>
<head>
<title>FRNB</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<NOSCRIPT><meta http-equiv="refresh"
content="0;URL=nojava.htm"></NOSCRIPT>
</head>
<frameset rows="125,*" frameborder="10" border="0" framespacing="0"
cols="*">
<frame name="topFrame" src="top.asp" marginwidth="0"
marginheight="0" >
<frame name="BottomFrame" src="bas.asp" marginwidth="0"
marginheight="0" >
</frameset>
<noframes>
<body>
</body>
</noframes>
</html>
################################################################################
Voici le code de la page : bas.asp
################################################################################
<html>
<head>
<title>FRNB</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<script language="JavaScript" src="noframe.js"></script>
</head>
<frameset cols="60%,*" border="10" framespacing="0" frameborder="0">
<frame name="leftFrame" src="left.asp" scrolling="yes">
<frame name="rightFrame" src="right.asp" scrolling="yes">
</frameset>
<noframes>
<body></body>
</noframes>
</html>
################################################################################
Voici le code de la page : top.asp
################################################################################
<html>
<head>
<title>default</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<link rel="stylesheet" href="../../../css/general.css"
type="text/css">
<!-- script language="JavaScript" src="noframe.js"></script -->
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image;
d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc)
x.oSrc=x.src; x.src=a[i+2];}
}
function OuvrirPopup(sURL) {
var hauteur = 350;
var largeur = 400;
window.open(sURL,"popup","top="+((screen.height-hauteur)/2)+",left="+((screen.width-largeur)/2)+",width="+largeur+",height="+hauteur+",scrollbars=yes,resizable=yes,menubar=yes");
}
function EffacerSelection() {
for (i = 0; i < parent.BottomFrame.leftFrame.LISTE.length; i++) {
if (parent.BottomFrame.leftFrame.LISTE.elements[i].type=="checkbox")
{
parent.BottomFrame.leftFrame.LISTE.elements[i].checked =
false;
}
}
}
function EtapeSuivante() {
parent.BottomFrame.leftFrame.LISTE.submit();
}
function ChangerLangue(sLangue) {
var sPage = parent.BottomFrame.rightFrame.location.href;
$longueur = sPage.indexOf('&lg=',1);
if ($longueur > 0) { sPage = sPage.substr(0,$longueur); }
else { sPage = sPage + "&lg=" + sLangue; }
parent.BottomFrame.rightFrame.location = sPage;
}
function ModifierSelection() {
parent.BottomFrame.leftFrame.location = "left.asp";
}
function DocumentFinal() {
var hauteur = 300;
var largeur = 350;
window.open("confirm.asp","popup","top="+((screen.height-hauteur)/2)+",left="+((screen.width-largeur)/2)+",width="+largeur+",height="+hauteur+",scrollbars=yes,resizable=yes,menubar=yes");
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF"
onLoad="MM_preloadImages('../images/home_over.gif','../images/nl_over.gif','../images/fr_over.gif','../images/extenso<%=session("sLangue")%>_over.gif','../images/aide<%=session("sLangue")%>_over.gif','../images/confirmer<%=session("sLangue")%>_over.gif','../images/effacer<%=session("sLangue")%>_over.gif','../images/modifier<%=session("sLangue")%>_over.gif')">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class=title align=center><%=TTitle%></td>
</tr>
<!--<tr><td colspan="2" width="784"><img src="../images/space.gif"
width="784" height="1"></td>></tr>
<tr><td width="82"></td>
<td rowspan="2" width="702"><img
src="../images/top_a_<%=session("sLangue")%>.gif" width="702"
height="119"></td>
</tr>
<tr><td width="82"><img src="../images/01<%=session("sLangue")%>.gif"
width="82" height="101"></td></tr>-->
</table>
<!-- IN EXTENSO -->
<span id="Layer6" style="position:absolute;left:20px;top:80px;width:136px;height:19px;z-index:1;visibility:visible"><a
href="#"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('ImgExtenso','','../images2/extenso<%=session("sLangue")%>_over.gif',1)"
onClick="OuvrirPopup('complet.asp')"><img name="ImgExtenso"
src="../images2/extenso<%=session("sLangue")%>.gif" width="136"
height="19" border="0"></a></span>
<!-- CONFIRMER UN -->
<span id="Layer1" style="position:absolute;left:155px;top:80px;width:133px;height:19px;z-index:1;visibility:hidden"><input
type="image" name="ImgConfirmer1"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('ImgConfirmer1','','../images2/confirmer<%=session("sLangue")%>_over.gif',1)"
src="../images2/confirmer<%=session("sLangue")%>.gif" width="133"
height="19" border="0" onclick="EtapeSuivante();"></span>
<!-- CONFIRMER DEUX : document final -->
<span id="Layer4" style="position:absolute;left:155px;top:80px;width:133px;height:19px;z-index:1;visibility:visible"><input
type="image" name="ImgConfirmer2"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('ImgConfirmer2','','../images2/confirmer<%=session("sLangue")%>_over.gif',1)"
src="../images2/confirmer<%=session("sLangue")%>.gif" width="133"
height="19" border="0" onclick="DocumentFinal();"></span>
<!-- EFFACER -->
<span id="Layer2" style="position:absolute;left:288px;top:80px;width:128px;height:19px;z-index:1;visibility:visible"><input
type="image" name="ImgEffacer"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('ImgEffacer','','../images2/effacer<%=session("sLangue")%>_over.gif',1)"
src="../images2/effacer<%=session("sLangue")%>.gif" width="128"
height="19" border="0" onclick="EffacerSelection();"></span>
<!-- MODIFIER -->
<span id="Layer5" style="position:absolute;left:288px;top:80px;width:128px;height:25px;z-index:1;visibility:hidden"><input
type="image" name="ImgModifier"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('ImgModifier','','../images2/modifier<%=session("sLangue")%>_over.gif',1)"
src="../images2/modifier<%=session("sLangue")%>.gif" width="128"
height="19" border="0" onclick="ModifierSelection();"></span>
<!-- LANGUE -->
<span id="Layer3" style="position:absolute;left:655px;top:1px;width:129px;height:18px;z-index:1;visibility:hidden"><%
%></span>
<!-- AIDE -->
<span id="Layer7" style="position:absolute;left:620px;top:80px;width:49px;height:19px;z-index:1;visibility:hidden"><a
href="#"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('ImgAide','','../images2/aide<%=session("sLangue")%>_over.gif',1)"
onClick="OuvrirPopup('aide_<%=session("sLangue")%>.asp')"><img
name="ImgAide"
src="../images2/aide<%=session("sLangue")%>.gif" width="49"
height="19" border="0"></a></span>
<!-- REAGIR -->
<span id="Layer9" style="position:absolute;left:669px;top:80px;width:62px;height:19px;z-index:1;visibility:visible"><a
href="#"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('ImgReagir','','../images2/reagir_<%=session("sLangue")%>_over.gif',1)"
onclick="window.open('../../../cat_eloket/koopakte.asp','reagir','top='+((screen.height-500)/2)+',left='+((screen.width-750)/2)+',width='+750+',height='+500+',scrollbars=yes,resizable=yes,menubar=yes');"><img
name="ImgReagir"
src="../images2/reagir_<%=session("sLangue")%>.gif" width="62"
height="19" border="0"></a></span>
<!-- RECHERCHE -->
<span id="Layer8" style="position:absolute;left:415px;top:80px;width:80px;height:19px;z-index:1;visibility:visible"><a
href="#"
onClick="AvecRech()" onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('ImgRech','','../images2/rech_<%=session("sLangue")%>_over.gif',1)"><img
name="ImgRech" src="../images2/rech_<%=session("sLangue")%>.gif"
width="80" height="19" border="0"></a></span>
<script language="JavaScript">
function AvecRech() {
// alert('ici');
var sTest = top.BottomFrame.leftFrame.location.href;
// alert(sTest.indexOf("left"));
if ( sTest.indexOf("left")>=0 ) {
top.BottomFrame.leftFrame.LISTE.action="summary.asp?retour=framerecherche";
top.BottomFrame.leftFrame.LISTE.submit();
}
else {top.location.href="framerecherche.asp";}
//alert('ici 2 ');
}
</script>
</body>
</html>
################################################################################
Voici le code de la page : left.asp
################################################################################
<html>
<head>
<meta http-equiv=Content-Type content="text/html;
charset=windows-1252">
<title>FRNB</title>
<link rel="stylesheet" href="styles.css" type="text/css">
<link rel="stylesheet" href="liste.css" type="text/css">
<script language="JavaScript" src="noframe.js"></script>
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image;
d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc)
x.oSrc=x.src; x.src=a[i+2];}
}
function ViderForm() {
for (i = 0; i < document.LISTE.length; i++) {
if (document.LISTE.elements[i].type=="checkbox") {
document.LISTE.elements[i].checked = false;
}
}
}
function Visible() {
//parent.rightFrame.location='right.asp';
parent.frames['rightFrame'].location='right.asp';
//parent.parent.frames['topFrame'].Layer1.style.visibility =
"visible";
parent.parent.frames['topFrame'].Layer2.style.visibility = "visible";
parent.parent.frames['topFrame'].Layer4.style.visibility = "hidden";
parent.parent.frames['topFrame'].Layer5.style.visibility = "hidden";
}
function NonVisible() {
//parent.parent.topFrame.Layer1.style.visibility = "hidden";
//parent.parent.topFrame.Layer2.style.visibility = "hidden";
}
//-->
</script>
</head>
<body bgcolor="#ffffff" onUnLoad="NonVisible()"
onLoad="Visible();MM_preloadImages('../images/confirmer2<%=session("sLangue")%>_over.gif')">
<form name="LISTE" method="post" action="summary.asp">
<input type="hidden" name="mkjmkjmklj" value="ljhlkhglhg">
<%
response.Write("test")
%>
<p><input name="ImgConfirmer" type="image"
src="../images/confirmer2<%=session("sLangue")%>.gif" width="141"
height="26" border="0"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('ImgConfirmer','','../images/confirmer2<%=session("sLangue")%>_over.gif',1)"
onclick="document.LISTE.submit();"></p>
</form>
</body>
</html>
################################################################################
Réponses
|