Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > JavaScript
JavaScript Forum programmation JavaScript. Lire : Cours JavaScript, FAQ JavaScript, Toutes les FAQ JavaScript et Sources JavaScript
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 23/12/2010, 18h52   #1
Invité régulier
 
Inscription : novembre 2010
Messages : 34
Détails du profil
Informations forums :
Inscription : novembre 2010
Messages : 34
Points : 7
Points : 7
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 :
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
chadoum est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 23/12/2010, 19h08   #2
Expert Confirmé Sénior
 
Avatar de RomainVALERI
 
Homme Romain VALERI
POOête
Inscription : avril 2008
Messages : 2 572
Détails du profil
Informations personnelles :
Nom : Homme Romain VALERI
Âge : 35
Localisation : France, Meurthe et Moselle (Lorraine)

Informations professionnelles :
Activité : POOête

Informations forums :
Inscription : avril 2008
Messages : 2 572
Points : 4 073
Points : 4 073
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 ?
__________________

...pour les linguistes et les curieux >>> générateur de phrases aléatoires

__________________
RomainVALERI est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 23/12/2010, 19h12   #3
Invité régulier
 
Inscription : novembre 2010
Messages : 34
Détails du profil
Informations forums :
Inscription : novembre 2010
Messages : 34
Points : 7
Points : 7
Oui tout est correct et tout fonctionne sur les autres browsers...
chadoum est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 23/12/2010, 19h43   #4
Rédacteur/Modérateur
 
Avatar de SpaceFrog
 
Homme
Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Analyste Programmeur
Inscription : mars 2002
Messages : 30 001
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : Royaume-Uni

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

Informations forums :
Inscription : mars 2002
Messages : 30 001
Points : 45 077
Points : 45 077
Code :
<a href="contact.html" onClick= "window.location.href('contact.html');">Contact</a>
???

Code :
<a href="contact.html" onClick= "window.location.assign('contact.html');">Contact</a>
ou

Code :
<a href="contact.html" onClick= "window.location.href='contact.html';">Contact</a>
__________________
Ma page Developpez
Président du CCMPTP (Comité Contre le Mot "Problème" dans les Titres de Posts)
Deux règles du succès: 1) Ne communiquez jamais à quelqu'un tout votre savoir...
Votre post est résolu ? Alors n'oubliez pas le Tag


réalisations :www.planet-languages.com|www.saftair.com| www.ouestisol.fr | www.sebemex.fr | www.extramiante.fr | www.sistac-alizay.fr | www.acoustishop.fr | www.litt.fr | www.ouestventil.fr
SpaceFrog est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 23/12/2010, 19h52   #5
Invité régulier
 
Inscription : novembre 2010
Messages : 34
Détails du profil
Informations forums :
Inscription : novembre 2010
Messages : 34
Points : 7
Points : 7
Toujours la même erreur...
chadoum est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 23/12/2010, 21h59   #6
Expert Confirmé Sénior
 
Avatar de RomainVALERI
 
Homme Romain VALERI
POOête
Inscription : avril 2008
Messages : 2 572
Détails du profil
Informations personnelles :
Nom : Homme Romain VALERI
Âge : 35
Localisation : France, Meurthe et Moselle (Lorraine)

Informations professionnelles :
Activité : POOête

Informations forums :
Inscription : avril 2008
Messages : 2 572
Points : 4 073
Points : 4 073
Tu as un lien ? histoire qu'on essaie de reproduire pour en savoir plus ^^
__________________

...pour les linguistes et les curieux >>> générateur de phrases aléatoires

__________________
RomainVALERI est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 24/12/2010, 09h04   #7
Invité régulier
 
Inscription : novembre 2010
Messages : 34
Détails du profil
Informations forums :
Inscription : novembre 2010
Messages : 34
Points : 7
Points : 7
Donc cette page-là:
Code :
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 :
1
2
 
<a href="contact.html" onClick= "window.location.href='contact.html';">Contact</a>
Est censé mener à cette page:
Code :
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!)
chadoum est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 24/12/2010, 09h19   #8
Invité régulier
 
Inscription : novembre 2010
Messages : 34
Détails du profil
Informations forums :
Inscription : novembre 2010
Messages : 34
Points : 7
Points : 7
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...
chadoum est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 24/12/2010, 10h53   #9
Invité régulier
 
Inscription : novembre 2010
Messages : 34
Détails du profil
Informations forums :
Inscription : novembre 2010
Messages : 34
Points : 7
Points : 7
Pour ceux que ça intéresse, j'ai trouvé la solution:
Insérer dans la balise head:
Code :
<!-- saved from url=(0013)about:internet -->

Joyeuses fêtes!
chadoum est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 10h59.


 
 
 
 
Partenaires

Hébergement Web