From: SAM on
Le 6/7/10 6:16 AM, Kevin a �crit :
> Two functions:
>
> function drawHotLinkButton(name) // onBodyLoad calls "paint the
> screen," which calls drawHotLinkButton(name) to draw a button
> // on the screen that opens a new
> webpage, webpage.html?xml=something.xml, when the button's clicked.
> {
> document.write("<input name=\"" + name + "\" type=\"button\" \/
>> ");
> }

function drawHotLinkButton(aName) {
var b = document.createElement('BUTTON');
b.name = aName;
b.innerHTML = 'save';
b.onclick = upToDate;
document.getElementById('somewhere').appendChild(b);
}

function upToDate() {
if(xmlDoc && xmlDoc.getElementsByName(this.name)[0])
{
this.value = xmlDoc.getElementsByName(this.name)[0].nodeValue;
alert(document.getElementsByName(this.name)[0].value); // verif
}
else alert('KK prout prout');
}


--
sm