beautypg.com

Rockwell Automation 1768-EWEB EtherNet/IP Web Server Module User Manual User Manual

Page 105

background image

Publication ENET-UM527E-EN-P - October 2006

Create Custom Web Pages 105

if (STR_ACTIVEX.indexOf(".DOMDocument") != -1) {

xmlhttp = new ActiveXObject(STR_ACTIVEX.substring(0, STR_ACTIVEX.indexOf(".DOMDocument")) +
".XMLHTTP");

} else {

alert("Creating/editing a data view requires Internet Explorer 5.5 or greater with XML support. Please
upgrade your browser or load the appropriate patches to support XML.");

history.go(-1);

}

function refresh_value() {

xmlDoc.load(DATAVIEW_URI);

xmlDoc.setProperty("SelectionNamespaces", "xmlns:dv='" + DATAVIEW_NAMESPACE + "'");

document.getElementById("tagvalue").value =
xmlDoc.selectSingleNode("/dv:view/dv:tag[@name='TEST']/dv:value").childNodes[0].nodeValue;

}

function update_value() {

xmlDoc.selectSingleNode("/dv:view/dv:tag[@name='TEST']/dv:value").childNodes[0].nodeValue =
document.getElementById("tagvalue").value;

xmlhttp.Open("POST", DATAVIEW_URI, false);

xmlhttp.Send(xmlDoc);

refresh_value();

}

TEST value is

onClick="update_value();" value="Update"/>

This manual is related to the following products: