Bonjour,

Je suis en train de réaliser un site web en AJAX, afin de pouvoir naviguer sur le site tout en écoutant de la musique. Je me retrouve donc avec pas mal de Javascript, le soucis est que mon code fonctionne parfaitement sur Firefox, mais à l'inverse, sur Internet Explorer 7, rien ne fonctionne, alors que j'ai vérifié, le Javascript est bien activé.

Je vous donne donc l'adresse du site (en construction) ainsi que les appels vers les fichiers .js ainsi que mon fichier contenant le Javascript.

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
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
		<style type="text/css">@import "template/orange/style.css";</style>
		<style type="text/css">@import "template/orange/style-js.css";</style>
 
		<script src="template/javascript/jquery-1.3.1.js" type="text/javascript" charset="utf-8"></script>
		<script src="template/javascript/jquery.wslide-0.1.0.js" type="text/javascript" charset="utf-8"></script>
		<script src="template/javascript/jquery.transition-2.0.0.js" type="text/javascript" charset="utf-8"></script>
		<script src="template/javascript/jquery.history.js" type="text/javascript" charset="utf-8"></script>
		<script src="template/javascript/myScripts.js" type="text/javascript" charset="utf-8"></script>
 
		<title>{TITLE_PAGE}</title>
	</head>
 
...
Et voila myScript.js, je vous épargne les fichiers jQuery qui ne doivent pas comporter d'erreurs.
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
 
function GetId(id) {
	return document.getElementById(id);
}
 
 
// Change la couleur du champ formulaire lorsqu'on clique dessus
function input_color(current_obj) {
	var objList = new Array("name", "email", "subject", "msg");
 
	for(var i = 0; i < 4; i++) {
		var obj = GetId(objList[i]);
		var error = GetId("error_" + objList[i]);
		if(objList[i] == current_obj) { 
			obj.style.backgroundColor = "#FEFFCC";
			error.style.display = "none";
		} else obj.style.backgroundColor = "";
	}
}
 
// Vérifie la valeur des champs du formulaire
function form_check() {
	var result = true;
 
	if(document.contact.msg.value == "") {
		//var error = GetId("error_msg");
		//error.style.display = "inline";
		document.contact.msg.focus();
		result = false;
	}
 
	if(document.contact.subject.value == "") {
		var error = GetId("error_subject");
		error.style.display = "inline";
		document.contact.subject.focus();
		result = false;
	}
 
	if(document.contact.email.value == "") {
		var error = GetId("error_email");
		error.style.display = "inline";
		document.contact.email.focus();
		result = false;
	} else {
		if(document.contact.email.value.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/) == -1) {
			var error = GetId("error_email");
			error.style.display = "inline";			
			document.contact.email.focus();
			result = false;
		}
	}
 
	if(document.contact.name.value == "") {
		var error = GetId("error_name");
		error.style.display = "inline";
		document.contact.name.focus();
		result = false;
	}
 
	return result;
 
}
 
// PageLoad function
// This function is called when:
// 1. after calling $.historyInit();
// 2. after calling $.historyLoad();
// 3. after pushing "Go Back" button of a browser
function pageload(hash) {
 
	if(hash) {
 
		var i = hash.indexOf("-");
		var part1 = "";
		var part2 = "";
 
		if(i == -1) {
			hash = hash + ".php";
			if(hash == "actu.php") hash = "news.php"; 
		} else {
			part1 = hash.substr(0, i);
			part2 = hash.substr(i + 1, hash.length);
			hash = part1 + ".php?page=" + part2;
		}
 
		$("#content").html('<p style="text-align: center; font-weight : bold; margin-top: 30px;">Chargement... <br /><br /><img src="./template/orange/images/loading.gif"></p>');
		setTimeout(function(){
			$("#content").load(hash, function(){
 
				$(".accordion h3:first").addClass("active");
				$(".accordion p:not(:first)").hide();
				$(".accordion h3").click(function(){
				$(this).next("p").slideToggle("slow").siblings("p:visible").slideUp("slow");
						$(this).toggleClass("active");
						$(this).siblings("h3").removeClass("active");
				});
 
				$('#newsSlide').wslide({
						width: 520,
						height: 500,
						horiz: true,
						duration: 1000,
				});
 
				$("#galerie2007").transition({
					title: "Elektrochoc 2007",
					images: [
						{image: "images/2007/01.jpg", thumb: "images/2007/thumb/01.jpg", title: "01.jpg"},
						{image: "images/2007/02.jpg", thumb: "images/2007/thumb/02.jpg", title: "02.jpg"},
						{image: "images/2007/03.jpg", thumb: "images/2007/thumb/03.jpg", title: "03.jpg"},
						{image: "images/2007/04.jpg", thumb: "images/2007/thumb/04.jpg", title: "04.jpg"},
						{image: "images/2007/05.jpg", thumb: "images/2007/thumb/05.jpg", title: "05.jpg"},
						{image: "images/2007/06.jpg", thumb: "images/2007/thumb/06.jpg", title: "06.jpg"},
						{image: "images/2007/07.jpg", thumb: "images/2007/thumb/07.jpg", title: "07.jpg"}
					],
 
					displayCaption: false,
					autoRun: true,
					displayTime: 5000,
					transitionTime: 500
				});
 
				$("#galerie2008").transition({
					title: "Elektrochoc 2008",
					images: [
						{image: "images/2008/01.jpg", thumb: "images/2008/thumb/01.jpg", title: "01.jpg"},
						{image: "images/2008/02.jpg", thumb: "images/2008/thumb/02.jpg", title: "02.jpg"},
						{image: "images/2008/03.jpg", thumb: "images/2008/thumb/03.jpg", title: "03.jpg"},
						{image: "images/2008/04.jpg", thumb: "images/2008/thumb/04.jpg", title: "04.jpg"},
						{image: "images/2008/05.jpg", thumb: "images/2008/thumb/05.jpg", title: "05.jpg"},
						{image: "images/2008/06.jpg", thumb: "images/2008/thumb/06.jpg", title: "06.jpg"},
						{image: "images/2008/07.jpg", thumb: "images/2008thumb/07.jpg", title: "07.jpg"},
						{image: "images/2008/08.jpg", thumb: "images/2008thumb/08.jpg", title: "08.jpg"}
					],
 
					displayCaption: false,
					autoRun: true,
					displayTime: 5000,
					transitionTime: 500
				});
 
			});					
		}, 400);
 
	} else {
 
		$("#content").html('<p style="text-align: center; font-weight : bold; margin-top: 30px;">Chargement... <br /><br /><img src="./template/orange/images/loading.gif"></p>');
		setTimeout(function(){
			$("#content").load("accueil.php");					
		}, 400);
 
	}
 
}
 
$(document).ready(function(){
	$.historyInit(pageload);
 
	$("a[@class='history']").click(function(){
		var hash = this.href;
		hash = hash.replace(/^.*#/, '');
		$.historyLoad(hash);
		return false;
	});
});
Si vous trouvez une erreur qui serait susceptible de bloquer le Javascript sur Internet Explorer et non sur Firefox, ou encore, si vous avez une suggestion, par exemple ca fonctionne chez vous avec Internet Explorer.
Je vous remercie d'avance.

Cordialement.

Spirit