Data Sheet
dScript
dScript User Manual v2.15
Logging out.
To log out add the following to the html on your page:
<a href="_loggedout.htm">Log out</a>
_loggedout.htm is a built in file that contains the “Logged out” message and a small piece of
javascript to delete the authorisation cookie. More importantly, the filename is recognised by
the module as a special file and it will invalidate the associated authorisation code.
Here is the index.htm file with the log out code included:
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dweb Simple Test Page</title>
</head>
<body>
<button id="Rly1" onmousedown="newAJAXCommand('dscript.cgi?Rly1=2');">Yard
Lights</button>
<br> <br>
Temperature: <div id="Temperature">?</div>
<br>
DC Voltage: <div id="DCvolts">?</div>
<br>
<a href="_loggedout.htm">Log out</a>
<script type="text/javascript">
function ajaxUpdate()
{
document.getElementById('Rly1').style.backgroundColor = (getValue('Rly1')=='1') ?
'rgba(255,0,0,0.2)' : 'rgba(0,0,255,0.2)';
document.getElementById('Temperature').innerHTML =
Number(getValue('Temperature')/10).toFixed(1);
document.getElementById('DCvolts').innerHTML = Number(getValue('Volts')/10).toFixed(1);
}
</script>
</body>
</html>
Copyright © 2016, Devantech Ltd.
All rights reserved.
www.robot-electronics.co.uk
47