Bonjour,

Quelqu'un(e) pourrait-il m'expliquer pourquoi ce code n'est pas interprété de la même manière par IE et FF ?

Sous FF, les images aparaissent bien dans la liste.

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
 
<html>
<head>
<script>
function change() {
 
if ( navigator.appName != 'Microsoft Internet Explorer' )
{
select = document.getElementById("select");
select.style.backgroundImage = select.options[select.selectedIndex].style.backgroundImage;
}
}
 
function sendDataverif(param, page, cadre)
{
	if(document.all)
	{
		//Internet Explorer
		var XhrObj = new ActiveXObject("Microsoft.XMLHTTP") ;
	}
	else
	{
	    //Mozilla
		var XhrObj = new XMLHttpRequest();
	}
 
	var content = document.getElementById(cadre);
 
 
	XhrObj.open("POST", page);
 
	XhrObj.onreadystatechange = function()
	{
		if (XhrObj.readyState == 4 && XhrObj.status == 200)
			content.innerHTML = XhrObj.responseText ;
	}
 
	XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	XhrObj.send(param);
}
</script>
</head>
<body>
<select size="1" id="select" style="width: 180px;" name="pays2" OnChange="change();sendDataverif('g=cat&id='+this.value,'http://www.maison-hote.fr/lirecat.php','cat')" onKeyUp="sendDataverif('g=cat&id='+this.value,'http://www.maison-hote.fr/lirecat.php','cat')">
<option style="background:url('fr.png') no-repeat; width:16px; height:16px;padding-left: 20px;" value=143 selected>France</option>
<option style="background:url('be.png') no-repeat; width:16px; height:16px;padding-left: 20px;" value=130>Belgique</option>
<option style="background:url('lu.png') no-repeat; width:16px; height:16px;padding-left: 20px;" value=140>Luxembourg</option>
<option style="background:url('ch.png') no-repeat; width:16px; height:16px;padding-left: 20px;" value=186>Suisse</option>
</select>
</body>
</html>