Gcobani Mkontwana in MATLAB Answers
上次活动时间: 2019-11-12

Hi Team I am testing my ajax URL to download cvs file using GET method, these are my paremeters channel for my plugin. GET https://api.thingspeak.com/channels/899906/feeds.csv?start=2019-11-11%2019:11:11&end=2019-11-08%2019:11:11 How do i resolve this issue? I need some help, thanks. $(document).ready(function() { $("#download").click(function() { $.ajax({ url:'https://api.thingspeak.com/channels/899906/feeds.csv?start=2019-11-11%2019:11:11&end=2019-11-11%2019:11:11', type:'GET', success:function(response){ window.location = response; } }); }); });
Gcobani Mkontwana in MATLAB Answers
上次活动时间: 2019-11-10

Hi Team I am using Jquery and communicate with my channel because i created a normal plugin for my UI. I want to find if there is a way in Jquery that you can download date range using datapicker, i am searching online nothing seem to appear similar to what i am aiming to achieve. Kindly please assist me thanks.
Gcobani Mkontwana in MATLAB Answers
上次活动时间: 2019-11-7

Hi Team I want to change the status of a message to be true, when the button is clicked 'on' and vice versa when is clicked off to be off. So far the functionality seem working not according to what i need it to be. e.g If my button is off, button continues to previous state as true(on). Off which i dont want that, want current state the button to be it remain and keep its value. Like if its on should be remain its value as on, same applies to off logic. I am struggling to get this work. I show you my code so far what i have done. <!---HTML code----> <body> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"><br/> <div class ="success"></div> <div class = "warning"></div> <div class="col-md-2 text-center"> <button id="singlebutton" name="singlebutton" class="btn btn-danger" onclick="BtnOff();">Off</button> <br> </div> <!------ ----> <br/> <div class = "col-md-2 text-center"> <button id = "singlebtn" name="singlebtn" class="btn btn-success" onclick = "BtnOn();">On</button> <br> </div> </body> </html> <!----Javascript code----> <script src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script> function BtnOff() { $.ajax({ url:'https://api.thingspeak.com/update?api_key=D****&field8=0', type:'GET', data:{ type:'text' }, success:function(response){ alert(response); $('div.warning').html('status changed to zero').delay(1000).fadeOut(); $('#singlebutton').append(data); } }); //setTimeout("Subscribe()", 100); } // second button to unsubscribe. function BtnOn() { $.ajax({ url:'https://api.thingspeak.com/update?api_key=*****&field8=1', type:'GET', data:{ type:'text' }, success:function(response){ alert(response); $('div.success').html('status changed to one').delay(1000).fadeOut(); $('#singlebtn').append(data); } }); //setTimeout("UnSubscribe()", 100); } </script>
Gcobani Mkontwana in MATLAB Answers
上次活动时间: 2019-11-6

Hi Team Is there any mate who can show me in Ajax, if there is better approach to read values in your ajax call request? That will read these values as they are passed on your parameter. What i want to achieve is similar to an example of light bulb, if the bulb is set true is on. If the bulb is set false is off. Now i want something similar to my below code logic for my current channel. Currently the buttons only accept these moment they are fired from the browser, i want a better approach and scale my application better. <div class="col-md-2 text-center"> <button id="singlebutton" name="singlebutton" class="btn btn-primary">Subscribe</button> <br> </div> <!------ ----> <br/> <div class = "col-md-2 text-center"> <button id = "singlebtn" name="singlebtn" class="btn btn-primary">Unsubscribe</button> <br> </div> <script src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script> $(document).ready(function(){ $.ajax({ url:'https://api.thingspeak.com/update?api_key=***&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); } }); // second button for unsubscribe. $(document).ready(function(){ $.ajax({ url:'https://api.thingspeak.com/update?api_key=***&field8=1', type:'GET', data:{ format:'text' }, success:function(response){ alert(response); }, error:function(){ $('#error').text("There was an error processing your request.Please try again"); $('#singlebtn').append(data); } }); }); }); </script>

关于 ThingSpeak

The community for students, researchers, and engineers looking to use MATLAB, Simulink, and ThingSpeak for Internet of Things applications. You can find the latest ThingSpeak news, tutorials to jump-start your next IoT project, and a forum to engage in a discussion on your latest cloud-based project. You can see answers to problems other users have solved and share how you solved a problem.