Hi Team
I have created a switch button, toggle button and it seem not working. Meaning i want my button when it switch on must send an update to my channel to thingspeak and when it switch off must do the same. Please help me to achieve this logic, thanks.
// button click functionality here.
$(document).ready(
function() {
$.ajax({
url:'https://api.thingspeak.com/update?api_key=DLQ0F7W5FGVO1I9Q&field8=1',
type:'GET',
data:{
format:'text'
},
success:function(response) {
alert(response);
},
error:function(xhr,status, errorThrown) {
console.log("There was an error processing your request" + errorThrown);
console.log("Status:" + status);
console.log(xhr);
},
complete:function(xhr,status) {},
});
}
)
Jenith ThakkarPosted Nov 13, 2019, 3:40 AM
Guest UserPosted Nov 13, 2019, 2:22 AM
Jenith ThakkarPosted Nov 13, 2019, 1:29 AM
Guest UserPosted Nov 13, 2019, 1:03 AM
Jenith ThakkarPosted Nov 13, 2019, 12:53 AM
Please check below link for your reference