Skip to content

Commit

Permalink
Made some small tweaks to chkscale.php, notably disabling the listen(…
Browse files Browse the repository at this point in the history
…) call unless the OS is Linux.
  • Loading branch information
lgedgar committed Apr 8, 2010
1 parent 4ec8cd0 commit 897a9c2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pos/is4c/chkscale.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<script type="text/javascript">
var xmlHttp;
var anotherXmlHttp;
var xmlmessage = "ok";
var xmldata = '';

function createXMLHttpRequest() {
if (window.ActiveXObject) {
Expand Down Expand Up @@ -44,9 +44,8 @@ function startAnotherRequest(url) {
function handleStateChange() {
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200) {
if (xmlmessage != xmldata) {
var xmldata = xmlHttp.responseText;
// alert(xmldata);
if (xmldata != 'ok') {
xmldata = xmlHttp.responseText;
startAnotherRequest("scale.php?reginput="+xmldata);
xmldata = "";
}
Expand Down Expand Up @@ -75,7 +74,9 @@ function listen() {
startRequest("rs232/scale");
setTimeout("listen();", 70);
}
listen();
<?php if ($_SESSION['OS'] == 'linux'): ?>
listen();
<?php endif; ?>
</script>
<table border=0 cellspacing=0 cellpadding=0>
<tr>
Expand Down

0 comments on commit 897a9c2

Please sign in to comment.