I made this html that is responsible for controlling some relays in my arduino. On the pc my mac opening it with google chrome works perfectly. But when I compile it with phonegap and run it on Android, the GET requests are not sent. I strike the switches and the relays do not fire. Does anyone know what this is?
I leave my code
<span class="switch">
<span class="switch-border1">
<span class="switch-border2">
<input id="switch1" type="checkbox"/>
<label for="switch1"></label>
<span class="switch-top"></span>
<span class="switch-shadow"></span>
<span class="switch-handle"></span>
<span class="switch-handle-left"></span>
<span class="switch-handle-right"></span>
<span class="switch-handle-top"></span>
<span class="switch-handle-bottom"></span>
<span class="switch-handle-base"></span>
<span class="switch-led switch-led-green">
<span class="switch-led-border">
<span class="switch-led-light">
<span class="switch-led-glow"></span>
</span>
</span>
</span>
<span class="switch-led switch-led-red">
<span class="switch-led-border">
<span class="switch-led-light">
<span class="switch-led-glow"></span>
</span>
</span>
</span>
</span>
</span>
</span>
<span class="switch">
<span class="switch-border1">
<span class="switch-border2">
<input id="switch2" type="checkbox" />
<label for="switch2"></label>
<span class="switch-top"></span>
<span class="switch-shadow"></span>
<span class="switch-handle"></span>
<span class="switch-handle-left"></span>
<span class="switch-handle-right"></span>
<span class="switch-handle-top"></span>
<span class="switch-handle-bottom"></span>
<span class="switch-handle-base"></span>
<span class="switch-led switch-led-green">
<span class="switch-led-border">
<span class="switch-led-light">
<span class="switch-led-glow"></span>
</span>
</span>
</span>
<span class="switch-led switch-led-red">
<span class="switch-led-border">
<span class="switch-led-light">
<span class="switch-led-glow"></span>
</span>
</span>
</span>
</span>
</span>
</span>
<script type="text/javascript">
var ip = '192.168.0.104';
function on(id) {
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
var url = "http://"+ip+"/r"+id+"=ON";
xmlhttp.open("GET", url, false);
xmlhttp.send(null);
var respo= xmlhttp.responseText;
}
function off(id) {
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
var url = "http://"+ip+"/r"+id+"=OFF";
xmlhttp.open("GET", url, false);
xmlhttp.send(null);
var respo= xmlhttp.responseText;
}
var checkbox = document.getElementById('switch1');
checkbox.addEventListener("change", comprueba, false);
function comprueba(){
if(checkbox.checked){
on(1);
}else{
off(1);
}
}
var checkbox_2 = document.getElementById('switch2');
checkbox_2.addEventListener("change", comprueba2, false);
function comprueba2(){
if(checkbox_2.checked){
on(2);
}else{
off(2);
}
}