<script src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script> function Subscribe() { $.ajax({ url:'https://api.thingspeak.com/update?api_key=***&field8=0', type:'GET', data:{ type:'text' }, success:function(response){ alert(response); $('#singlebutton').append(data); } }); setTimeout("Subscribe()", 100); } // second button to unsubscribe. function UnSubscribe() { $.ajax({ url:'https://api.thingspeak.com/update?api_key=***&field8=1', type:'GET', data:{ type:'text' }, success:function(response){ alert(response); $('#singlebtn').append(data); } }); //setTimeout("UnSubscribe()", 100); } </script>
var h = setTimeout("Subscribe()", 100);
clearTimeout(h);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)