O'Reilly logo

Getting Started with the Internet of Things by Cuno Pfister

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Embed a JavaScript Test Client on the Netduino

Web browsers are convenient HTTP clients because they are available on practically any platform, and also because they can download new programs (scripts) without extra installation hassles. The trick is that script code can be embedded in HTML pages, so ordinary HTTP GET requests are sufficient as download mechanisms for JavaScript programs. Since JavaScript can issue PUT requests, you can click buttons on a web page to turn your LEDs on and off!

And since the Netduino Plus is functioning as a web server, you can serve this JavaScript directly from your .NET Micro Framework code!

To include some JavaScript in an HTML document, add a <script> XML element with the code shown in Example 12-5. (Example 12-6 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required