Bonjour,

je n'arrive pas a trouver de solution sous IE pour pouvoir ajouter des methodes à "OBJECT" voila mon code :
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
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="fr" xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
 
	<head>
		<title>DOCUMENT DE BASE</title>
 
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
		<meta name="description" lang="fr" content="" />
		<meta name="keywords" content="" />
 
		<script type="text/javascript">
		Object.prototype.addClass=function(TsClass){
			if(this.className.indexOf(TsClass) != -1){return;}
			var TsTabClassName = this.className.split(' ');
			TsTabClassName.push(TsClass);
			this.className = TsTabClassName.join(' ');
		}
 
		window.onload = function(){
			document.getElementById('middle').addClass('blablabla');
		}
		</script>
	</head>
 
	<body class="langue_fr">
		<div id="global">
			<div id="middle">
				middle
			</div> <!-- FIN middle -->
		</div> <!-- FIN global -->
	</body>
</html>
Sous Firefox cela fonctionne mais sous IE j'ai une erreur "Cette objet ne gere pas cette propriete ou cette methode".

Merci d'avance pour votre aide.