|
Working with HTML |
Top Previous Next |
One of the strengths of programmable is that they feature a built-in webserver (of course, this is only true for devices that have a network interface and support TCP communications). You can use this webserver as an engine for server-side scripting; simply put, you can output dynamic HTML content by including Tibbo Basic instructions within HTML pages.
Here is a simple example:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN"> <HTML> <BODY>
BEGINNING OF OUTPUT<br>
<? dim i as integer for i = 1 to 10 ?>
<i> Foo </i> <br>
<? next i ?>
<br>END OF OUTPUT<br>
</BODY> </HTML>
|
In effect, this file would cause the following to appear in the browser window of the user accessing this page:
BEGINNING OF OUTPUT foo foo foo foo foo foo foo foo foo foo END OF OUTPUT
|
When to Use HTML Pages In Your Project
For an embedded device, built-in webserver can provide a convenient interface to this device; in fact, it is one of the best ways to allow your users to access your device remotely. They would just have to enter an address in a web browser, and voila, up comes your interface.
HTML support, as implemented in the Tibbo Basic, allows you complete control over page structure. You can use client-side technologies such as JavaScript, CSS etc., while still being able to dynamically generate HTML content within Tibbo device.
Further information about creating HTML files with dynamic content can be found in the next topic as well as Using HTTP topic (part of the sock object documentation).