TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
2.1k
467.1k
How to make your button reads your data?
Nov 27 2019 12:18 AM
Hi Team
I have this following code, it swich being enabled and disabled. Now i want to find a way if it is enable it must reads my data on thingspeak channel, using rest api key. Example below,
<input type=
"checkbox"
data-toggle=
"toggle"
data-on=
"Enabled"
data-off=
"Disabled"
>
<input type=
"checkbox"
id=
"toggle-two"
>
<script> $(
function
()
{ $(
'#toggle-two'
).bootstrapToggle({ on:
'Enabled'
, off:
'Disabled'
}); })
$.ajax({
url:
'https://api.thingspeak.com/update?api_key=DLQ0F7W5FGVO1I9Q&field8=0'
,
type:
'GET'
,
data:{
format:
'text'
},
success:
function
(response) {
alert(response);
},
error:
function
(){
$(
'#error'
).text(
"There was an error processing your request.Please try again"
);
$(
'#singlebutton'
).append(data);
}
});
}
</script>
Can anyone help me to improve this code better please, thanks.
Reply
Answers (
1
)
show tooltip content in center line highcharts
On/OFF button do not work