I have a div in an HTML page in witch I create a table that I fill with values from an XML file. Adding a msgbox at the end of the computing that displays my div innerHTML attribute give me everything allright but when displaying my page under IE6, my div is empty. Here is the code :
HTML page
Css (in case of ..)
Script
Water is not bad as long as it stays out human body ;-)
HTML page
Code:
<body onload="call ChargerXML()">
<div id="EnteteCircuits" class="DivTop" align="center">
</div>
</body>
Code:
.DivTop {
border : solid 1px #000000;
position : absolute;
top : 25px;
left : 5px;
width : 990px;
height : 100px;
overflow : auto;
display : block;
background : #F1F1F1;
z-index : 255;
}
Code:
Const MAX_WIDTH = 950
Const LIB_WIDTH = 450
function ChargerXML()
Set G_objXML = CreateObject("Microsoft.XMLDOM")
G_objXML.async = False
G_objXML.load ("LanceurLight.XML")
call ChargerCircuits()
end function
function ChargerCircuits()
Set objRootNode = G_objXML.SelectSingleNode("//" & XMLNOD_APPLI & "/" & XMLNOD_LSTCIRC)
Set objDetailNode = objRootNode.SelectSingleNode("./" & XMLNOD_DETAIL)
Set objHtmDiv = document.getElementById("EnteteCircuits")
objHtmDiv.innerHTML=""
Set objHtmTable = document.createElement("TABLE")
objHtmTable.border="0px"
objHtmTable.cellspacing="0px"
objHtmTable.cellpadding="0px"
objHtmTable.width=MAX_WIDTH & "px"
objHtmDiv.appendChild(objHtmTable)
Set objHtmTr = document.createElement("TR")
objHtmTr.height="100px"
objHtmTable.appendChild(objHtmTr)
Set objHtmTd = document.createElement("TD")
objHtmTd.style.width= LIB_WIDTH & "px"
objHtmTd.align="left"
objHtmTd.innerHtml=" "
objHtmTr.appendChild(objHtmTd)
set objLstNodes = objDetailNode.SelectNodes("./" & XMLNOD_CIRCUIT)
G_NbCircuits = objLstNodes.length
widthCircuits = (MAX_WIDTH - LIB_WIDTH ) / G_NbCircuits
For idx = 0 To G_NbCircuits - 1
Set objNode = objLstNodes.nextNode()
idCirc = objNode.getAttribute(XMLATT_IDENT)
coulCirc = objNode.getAttribute(XMLATT_COULEUR)
Set objHtmTd = document.createElement("TD")
objHtmTd.style.width= widthCircuits & "px"
objHtmTd.align="center"
objHtmTd.bgcolor=coulCirc
objHtmTd.innerHtml= idCirc
objHtmTr.appendChild(objHtmTd)
Next
msgbox objHtmDiv.innerHtml,, "objHtmDiv"
end function