IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JavaScript Discussion :

Ouverture de lien avec IE


Sujet :

JavaScript

  1. #1
    Membre actif
    Profil pro
    Développeur .NET
    Inscrit en
    Novembre 2010
    Messages
    127
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : Conseil

    Informations forums :
    Inscription : Novembre 2010
    Messages : 127
    Points : 288
    Points
    288
    Par défaut Ouverture de lien avec IE
    Bonjour,
    J'ai un problème sous IE (7 et 8).
    Cette page s'affiche correctement et fonctionne sous FF, mais sous IE je n'arrive pas à être redirigé quand je clique sur les liens des images
    ex: <a href="home.html">Home</a>
    alors j'ai essayé ça: <a href="contact.html" onClick= "window.location.href('contact.html');">Contact</a>
    et là la debugbar m'indique "Permission refusée"

    Mon code complet:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
     
     
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    	   "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    	<head>
    	<!-- saved from url=(0013)about:internet -->
    	<meta http-equiv="Content-Type" content="text/html">
    	<link rel="stylesheet" type="text/css" href="style.css">
    		<title>
    		Works
    		</title>
     
    	<script type="text/javascript">
    	function fondu()
    	{
    	var max = 100;
    	var min = 0;
    	var opacite=min;
    	up=true;
    	var IsIE = !!document.all;
    	var ThePic = document.getElementById('CANDELLIER4Thumb');
    	var ThePic2 = document.getElementById('R1aThumb');
    	var ThePic3 = document.getElementById('W1Thumb');
    	var ThePic4 = document.getElementById('skThumb');
    	var ThePic5 = document.getElementById('STUThumb');
    	var ThePic6 = document.getElementById('O1Thumb');
    	var liste_id = ["CANDELLIER4Thumb", "R1aThumb", "W1Thumb","skThumb", "STUThumb","O1Thumb"];
    	for (var i = 0, iMax = liste_id.length; i < iMax; ++i) 
    	{document.getElementById(liste_id[i]).style.visibility = "visible";}
     
    	function fadePic(){		
    					if (opacite<max && up){opacite+=2;}
    					//if (opacite>min && !up){opacite-=2;}
    					//if (opacite>=max){up=false;}
    					if (opacite<=min){up=true;}
     
    	IsIE?ThePic.filters[0].opacity=opacite:document.getElementById("CANDELLIER4Thumb").style.opacity = opacite/100;
    	IsIE?ThePic2.filters[0].opacity=opacite:document.getElementById("R1aThumb").style.opacity = opacite/100;
    	IsIE?ThePic3.filters[0].opacity=opacite:document.getElementById("W1Thumb").style.opacity = opacite/100;
    	IsIE?ThePic4.filters[0].opacity=opacite:document.getElementById("skThumb").style.opacity = opacite/100;
    	IsIE?ThePic5.filters[0].opacity=opacite:document.getElementById("STUThumb").style.opacity = opacite/100;
    	IsIE?ThePic6.filters[0].opacity=opacite:document.getElementById("O1Thumb").style.opacity = opacite/100;
    	//document.getElementById('CANDELLIER4Thumb','R1aThumb','W1Thumb','skThumb','STUThumb').value=opacite+"%"
    	}
    	setInterval(function(){fadePic();},100)
    	}
     
    	</script>
    	</head>
    <body> 
     
    <div id= "blocImg">
    <div id= "img0">
    <a href="works_C.html"><img id="CANDELLIER4Thumb" src="images/img/CANDELLIER4Thumb.jpg" alt="Image 1" width=110 height=110 style="opacity:0;-moz-opacity:0;filter:alpha(opacity=0);visibility: hidden;"></a>
    </div>
    <div id ="img1">
    <a href="works_R.html"><img id="R1aThumb" src="images/img/R1aThumb.jpg" alt="Image 1" width=110 height=110 style="opacity:0;-moz-opacity:0;filter:alpha(opacity=0);visibility: hidden;"></a>
    </div>
    <div id ="img2">
    <a href="works_W.html"><img id="W1Thumb" src="images/img/W1Thumb.jpg" alt="Image 1" width=110 height=110 style="opacity:0;-moz-opacity:0;filter:alpha(opacity=0);visibility: hidden;"></a></div>
    <div id ="img3">
    <a href="works_SK.html"><img id="skThumb" src="images/img/skThumb.jpg" alt="Image 1" width=110 height=110 style="opacity:0;-moz-opacity:0;filter:alpha(opacity=0);visibility: hidden;"></a></div>
    <div id ="img4">
    <a href="works_ST.html"><img id="STUThumb" src="images/img/STUThumb.jpg" alt="Image 1" width=110 height=110 style="opacity:0;-moz-opacity:0;filter:alpha(opacity=0);visibility: hidden;"></a>
    </div>
    <div id ="img5">
    <a href="works_O.html"><img id="O1Thumb" src="images/img/O1Thumb.jpg" alt="Image 1" width=110 height=110 style="opacity:0;-moz-opacity:0;filter:alpha(opacity=0);visibility: hidden;"></a>
    </div>
    </div>
    <script type="text/javascript">
    <!--
    fondu();
    -->
    </script>
     
    <div id="blocLeft">
    	<div id="titre">WORKS</div>
    	<div id="menu">
    	<a href="home.html">Home</a>
    	<br>
    	<a href="contact.html" onClick= "window.location.href('contact.html');">Contact</a>
    	<br>
    	<a href="cv.html">Cv</a>
    	</div>
    </div>		
    </body>
    </html>
    Pouvez-vous m'aider, je galère depuis 2 jours...
    Merci

  2. #2
    Expert confirmé
    Avatar de RomainVALERI
    Homme Profil pro
    POOête
    Inscrit en
    Avril 2008
    Messages
    2 652
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : France, Meurthe et Moselle (Lorraine)

    Informations professionnelles :
    Activité : POOête

    Informations forums :
    Inscription : Avril 2008
    Messages : 2 652
    Points : 4 164
    Points
    4 164
    Par défaut
    Ah oui tiens c'est bizarre

    L'essai d'ajout de JS est inutile ici, le lien classique est censé marcher (IE a des soucis, mais là quand même... ).

    Tu es sure de ton arborescence ? (vu la syntaxe de tes liens, les fichiers html doivent etre dans le même répertoire que la page courante... c'est bien le cas ?

  3. #3
    Membre actif
    Profil pro
    Développeur .NET
    Inscrit en
    Novembre 2010
    Messages
    127
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : Conseil

    Informations forums :
    Inscription : Novembre 2010
    Messages : 127
    Points : 288
    Points
    288
    Par défaut
    Oui tout est correct et tout fonctionne sur les autres browsers...

  4. #4
    Rédacteur/Modérateur

    Avatar de SpaceFrog
    Homme Profil pro
    Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Inscrit en
    Mars 2002
    Messages
    39 640
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 74
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2002
    Messages : 39 640
    Points : 66 665
    Points
    66 665
    Billets dans le blog
    1
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <a href="contact.html" onClick= "window.location.href('contact.html');">Contact</a>
    ???

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <a href="contact.html" onClick= "window.location.assign('contact.html');">Contact</a>
    ou

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <a href="contact.html" onClick= "window.location.href='contact.html';">Contact</a>

  5. #5
    Membre actif
    Profil pro
    Développeur .NET
    Inscrit en
    Novembre 2010
    Messages
    127
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : Conseil

    Informations forums :
    Inscription : Novembre 2010
    Messages : 127
    Points : 288
    Points
    288
    Par défaut
    Toujours la même erreur...

  6. #6
    Expert confirmé
    Avatar de RomainVALERI
    Homme Profil pro
    POOête
    Inscrit en
    Avril 2008
    Messages
    2 652
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : France, Meurthe et Moselle (Lorraine)

    Informations professionnelles :
    Activité : POOête

    Informations forums :
    Inscription : Avril 2008
    Messages : 2 652
    Points : 4 164
    Points
    4 164
    Par défaut
    Tu as un lien ? histoire qu'on essaie de reproduire pour en savoir plus ^^

  7. #7
    Membre actif
    Profil pro
    Développeur .NET
    Inscrit en
    Novembre 2010
    Messages
    127
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : Conseil

    Informations forums :
    Inscription : Novembre 2010
    Messages : 127
    Points : 288
    Points
    288
    Par défaut
    Donc cette page-là:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
     
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    	   "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    	<head>
    	<!-- saved from url=(0013)about:internet -->
    	<meta http-equiv="Content-Type" content="text/html">
    	<link rel="stylesheet" type="text/css" href="style.css">
    		<title>
    		Works
    		</title>
     
    	<script type="text/javascript">
    	function fondu()
    	{
    	var max = 100;
    	var min = 0;
    	var opacite=min;
    	up=true;
    	var IsIE = !!document.all;
    	var ThePic = document.getElementById('CANDELLIER4Thumb');
    	var ThePic2 = document.getElementById('R1aThumb');
    	var ThePic3 = document.getElementById('W1Thumb');
    	var ThePic4 = document.getElementById('skThumb');
    	var ThePic5 = document.getElementById('STUThumb');
    	var ThePic6 = document.getElementById('O1Thumb');
    	var liste_id = ["CANDELLIER4Thumb", "R1aThumb", "W1Thumb","skThumb", "STUThumb","O1Thumb"];
    	for (var i = 0, iMax = liste_id.length; i < iMax; ++i) 
    	{document.getElementById(liste_id[i]).style.visibility = "visible";}
     
    	function fadePic(){		
    					if (opacite<max && up){opacite+=2;}
    					//if (opacite>min && !up){opacite-=2;}
    					//if (opacite>=max){up=false;}
    					if (opacite<=min){up=true;}
     
    	IsIE?ThePic.filters[0].opacity=opacite:document.getElementById("CANDELLIER4Thumb").style.opacity = opacite/100;
    	IsIE?ThePic2.filters[0].opacity=opacite:document.getElementById("R1aThumb").style.opacity = opacite/100;
    	IsIE?ThePic3.filters[0].opacity=opacite:document.getElementById("W1Thumb").style.opacity = opacite/100;
    	IsIE?ThePic4.filters[0].opacity=opacite:document.getElementById("skThumb").style.opacity = opacite/100;
    	IsIE?ThePic5.filters[0].opacity=opacite:document.getElementById("STUThumb").style.opacity = opacite/100;
    	IsIE?ThePic6.filters[0].opacity=opacite:document.getElementById("O1Thumb").style.opacity = opacite/100;
    	//document.getElementById('CANDELLIER4Thumb','R1aThumb','W1Thumb','skThumb','STUThumb').value=opacite+"%"
    	}
    	setInterval(function(){fadePic();},100)
    	}
     
    	</script>
    	</head>
    <body> 
     
    <div id= "blocImg">
    <div id= "img0">
    <a href="works_C.html"><img id="CANDELLIER4Thumb" src="images/img/CANDELLIER4Thumb.jpg" alt="Image 1" width=110 height=110 style="opacity:0;-moz-opacity:0;filter:alpha(opacity=0);visibility: hidden;"></a>
    </div>
    <div id ="img1">
    <a href="works_R.html"><img id="R1aThumb" src="images/img/R1aThumb.jpg" alt="Image 1" width=110 height=110 style="opacity:0;-moz-opacity:0;filter:alpha(opacity=0);visibility: hidden;"></a>
    </div>
    <div id ="img2">
    <a href="works_W.html"><img id="W1Thumb" src="images/img/W1Thumb.jpg" alt="Image 1" width=110 height=110 style="opacity:0;-moz-opacity:0;filter:alpha(opacity=0);visibility: hidden;"></a></div>
    <div id ="img3">
    <a href="works_SK.html"><img id="skThumb" src="images/img/skThumb.jpg" alt="Image 1" width=110 height=110 style="opacity:0;-moz-opacity:0;filter:alpha(opacity=0);visibility: hidden;"></a></div>
    <div id ="img4">
    <a href="works_ST.html"><img id="STUThumb" src="images/img/STUThumb.jpg" alt="Image 1" width=110 height=110 style="opacity:0;-moz-opacity:0;filter:alpha(opacity=0);visibility: hidden;"></a>
    </div>
    <div id ="img5">
    <a href="works_O.html"><img id="O1Thumb" src="images/img/O1Thumb.jpg" alt="Image 1" width=110 height=110 style="opacity:0;-moz-opacity:0;filter:alpha(opacity=0);visibility: hidden;"></a>
    </div>
    </div>
    <script type="text/javascript">
    <!--
    fondu();
    -->
    </script>
     
    <div id="blocLeft">
    	<div id="titre">WORKS</div>
    	<div id="menu">
    	<a href="home.html">Home</a>
    	<br>
    	<a href="contact.html" onClick= "window.location.href='contact.html';">Contact</a>
    	<br>
    	<a href="cv.html">Cv</a>
    	</div>
    </div>	
    </body>
    </html>
    Par exemple, ce lien:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    <a href="contact.html" onClick= "window.location.href='contact.html';">Contact</a>
    Est censé mener à cette page:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
     
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    	   "http://www.w3.org/TR/html4/loose.dtd">	
    	<html>
     	<head>
    	<link rel="stylesheet" type="text/css" href="style.css">
    	<meta http-equiv="Content-Type" content="text/html">
    		<title>
    		Contact
    		</title>
     
    	</head>
    	<body>
    	<div id="blocLeft">
    		<div id="titre">CONTACT</div>
    		<div id="menu">
    		<a href="home.html">Home</a><br>
    		<a href="works.html">Works</a><br>		
    		<a href="cv.html">Cv</a>
    		</div>
    	</div>
    		<div id ="contact">
    		0032 475 31 50 71<br>
    		archidaph@gmail.com
    		</div>
    		<div id="conteneur">
    		<div id="yf">
    		Website by <a href="mailto:yfcreations@mail.be">YF</a>
    		</div>
    		</div>	
    	</body>
    </html>
    (ce qu'il fait avec les autres browsers!)

  8. #8
    Membre actif
    Profil pro
    Développeur .NET
    Inscrit en
    Novembre 2010
    Messages
    127
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : Conseil

    Informations forums :
    Inscription : Novembre 2010
    Messages : 127
    Points : 288
    Points
    288
    Par défaut
    Mais par contre, je travaille en local. Je pensais mettre en ligne le site d'ici qqs jours. Est-ce que IE ne bug pas à cause de ça? PArce que qd je regarde l'url, IE se comporte vraiment différemment des autres navigateurs...

  9. #9
    Membre actif
    Profil pro
    Développeur .NET
    Inscrit en
    Novembre 2010
    Messages
    127
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : Conseil

    Informations forums :
    Inscription : Novembre 2010
    Messages : 127
    Points : 288
    Points
    288
    Par défaut
    Pour ceux que ça intéresse, j'ai trouvé la solution:
    Insérer dans la balise head:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <!-- saved from url=(0013)about:internet -->

    Joyeuses fêtes!

Discussions similaires

  1. Ouverture de lien avec variable
    Par guenfood dans le forum Général JavaScript
    Réponses: 11
    Dernier message: 26/11/2013, 19h57
  2. Probleme d'ouverture de page avec lien
    Par JCMANSION dans le forum ASP.NET
    Réponses: 1
    Dernier message: 03/06/2010, 17h09
  3. ouverture lien avec document.location.href
    Par developpeur_débutant dans le forum Général JavaScript
    Réponses: 1
    Dernier message: 10/05/2010, 10h59
  4. Ouverture de lien avec window.open()
    Par Janitrix dans le forum Général JavaScript
    Réponses: 2
    Dernier message: 29/10/2007, 09h28

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo