Init EZParkingGPRS project into Coding.net
This commit is contained in:
88
WebContent/WEB-INF/pages/update.html
Normal file
88
WebContent/WEB-INF/pages/update.html
Normal file
@ -0,0 +1,88 @@
|
||||
<HTML>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
|
||||
<title>EZParking Update Position</title>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
var searchReq = createAjaxObj();
|
||||
function createAjaxObj()
|
||||
{
|
||||
var httprequest = false;
|
||||
if (window.XMLHttpRequest)
|
||||
{
|
||||
httprequest = new XMLHttpRequest()
|
||||
if (httprequest.overrideMimeType)
|
||||
httprequest.overrideMimeType('text/xml')
|
||||
}
|
||||
else if (window.ActiveXObject)
|
||||
{
|
||||
try
|
||||
{
|
||||
httprequest = new ActiveXObject("Msxml2.XMLHTTP");
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
try
|
||||
{
|
||||
httprequest = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
return httprequest
|
||||
}
|
||||
|
||||
function createQueryString()
|
||||
{
|
||||
var moduleID=document.getElementById("moduleID").value;
|
||||
|
||||
var statusAry = document.getElementsByName("statusId");
|
||||
for(var i=0; i<statusAry.length; i++)
|
||||
{
|
||||
if(statusAry[i].checked)
|
||||
{
|
||||
var status=statusAry[i].value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var queryString="moduleID=" + moduleID + "&status=" + status;
|
||||
return queryString;
|
||||
}
|
||||
|
||||
function updateStatus()
|
||||
{
|
||||
var queryString=createQueryString();
|
||||
|
||||
searchReq.open("POST", 'jqueryUpdateStatus', true);
|
||||
searchReq.onreadystatechange = handleEZParkingStatus;
|
||||
searchReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
|
||||
searchReq.send(queryString);
|
||||
}
|
||||
|
||||
function handleEZParkingStatus()
|
||||
{
|
||||
if (searchReq.readyState == 4)
|
||||
{
|
||||
alert("Update Successfully");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<Body>
|
||||
<div class="div">
|
||||
ModuleID:<input type="text" id="moduleID">
|
||||
<br/>
|
||||
Have Car:<input id="statusRadio" name="statusId" type="radio" value="1" />
|
||||
|
||||
No Car:<input id="statusRadio" name="statusId" type="radio" value="0" />
|
||||
<br/>
|
||||
<button type="button" onClick="updateStatus()">Update</button>
|
||||
<br/><br/>
|
||||
<img src="position.jpg" width="600" height="700" />
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user