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
|
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="test" />
<style>
#monModule
{
width : 300px;
height : 600px;
border : 3px black solid
}
</style>
<script>
///////////////MODULE1//////////////////
var monModule = {
largeur : 600+"px",
interface : function(div){
div.textContent = "helloword"
div.style.width = this.largeur
}
}
///////////////MODULE2//////////////////
function monModule2(div){
div.textContent = "helloword"
div.style.width = 600+"px"
}
</script>
</head>
<body>
<div id = "monModule">
</div>
<br/><br/>
<div id = "monModule2">
</div>
<script>
var module1 = document.getElementById("monModule")
monPremierModule = Object.create(monModule)
monPremierModule.interface(module1)
var module2 = document.getElementById("monModule2")
monModule2(module2)
</script>
</body>
</html> |
Partager