getElementById renvoi null
Bonjour,
Tout est dans le titre, un getElementByID me renvoi null alors que mon id est bien présent...
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
| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />
<link rel="stylesheet" type="text/css" href="styles.css" />
<title>index</title>
<script language ="JavaScript" type = "text/javascript">
djConfig = {parseOnLoad : true};
</script>
<script language ="JavaScript" type = "text/javascript" src= "js/dojotoolkit/dojo/dojo.js">
</script>
<script language ="JavaScript" type = "text/javascript">
function insertpiedpage(rows){
var parent_ppage = document.getElementById("pied_page");
var nbrpage = Math.round(rows/30);
var fragment_pied_page = document.createDocumentFragment();
var num = document.createElement("div");
var texte_num = document.createTextNode("oulala");
num.appendChild(texte_num);
parent_ppage.appendChild(num);
}
window.onload = insertpiedpage(30);
</script>
</head>
<body>
<div class="page">
<div class="bandeau"><IMG SRC="image/fry.png" width="800" height="200"></div>
<div class="contenu" id="contenu"></div>
<div class="pied_page" id="pied_page"></div>
</div>
</body>
</html> |
du coup je ne peut pas utiliser le parent_ppage.appendChild(num); qui ne marche pas