1 function requestUpdate(url, fieldName, targetName) { 2 var xmlhttp = Sarissa.getXmlHttpRequest(); 3 xmlhttp.open("POST", url, false); 4 var fieldValue = document.getElementsByName(fieldName)[0].value; 5 //alert(fieldValue); 6 xmlhttp.send(fieldName + "=" + fieldValue); 7 //alert(xmlhttp.status); 8 //alert(xmlhttp.responseText); 9 var newDocument = Sarissa.getDomDocument(); 10 newDocument.loadXML(xmlhttp.responseText); 11 //alert(newDocument); 12 var newElement = newDocument.getElementById(targetName); 13 var targetElement = document.getElementById(targetName); 14 //alert(newElement); 15 //alert(targetElement); 16 17 if (newElement != null && targetElement != null) { 18 var importedElement = document.importNode(newElement, true); 19 targetElement.parentNode.replaceChild(importedElement, targetElement); 20 //importedElement.setAttribute("style", "background-color:red;"); 21 } 22 }