google chrome fix
authorBernhard Tittelbach <xro@realraum.at>
Sat, 7 Aug 2010 11:40:16 +0000 (11:40 +0000)
committerBernhard Tittelbach <xro@realraum.at>
Sat, 7 Aug 2010 11:40:16 +0000 (11:40 +0000)
powersensordaemon/switch.cgi
powersensordaemon/ymhremote.html

index 58147d9..ee8074e 100755 (executable)
@@ -83,10 +83,12 @@ echo "<title>Realraum rf433ctl</title>"
 echo '<script type="text/javascript">'
 echo 'function sendButton( onoff, btn )'
 echo '{'
-echo  'var req = new XMLHttpRequest();'
-echo  'url = "http://slug.realraum.at/cgi-bin/switch.cgi?power="+onoff+"&id="+btn;'
-echo  'req.open("GET", url ,false);'
-echo  'req.send(null);'
+echo ' var req = new XMLHttpRequest();'
+echo ' url = "http://slug.realraum.at/cgi-bin/switch.cgi?power="+onoff+"&id="+btn;'
+echo ' req.open("GET", url ,false);'
+echo ' //google chrome workaround'
+echo ' req.setRequestHeader("googlechromefix","");'
+echo ' req.send(null);'
 echo '}'
 echo '</script>'
 echo "</head>"
index 22ebe64..085d111 100755 (executable)
@@ -10,6 +10,8 @@ function sendButton( btn )
   var req = new XMLHttpRequest();
   url = "http://slug.realraum.at/cgi-bin/switch.cgi?power=send&id="+btn;
   req.open("GET", url ,false);
+  //google chrome workaround
+  req.setRequestHeader("googlechromefix","");
   req.send(null);
   //response = req.responseText;
   //document.getElementById('output').innerHTML = response;