[En-Nut-Discussion] Ajax on ethernut
Ole Reinhardt
ole.reinhardt at embedded-it.de
Wed Nov 17 18:22:23 CET 2010
Hi Jörg,
> does anyone have any experience with ajax webfrontends on ethernut. Is
> there a recommandation for a softwarepackage?
We are using "Ajax" widely in a customers project together with normal
CGIs. The CGIs are transfering data in JSON format and are receiving the
data as standard POST requests.
As Ajax library we are using JQuery (http://jquery.com/), a very modular
and extendable javascript library which also has a nice set of
"widgets".
The JQuery library itself together with the plugins might become too
large for the internal flash of your board, but at least the flash of
Ethernut3 should be large enough. On the other hand you can hold your
webroot on an external flash card (SD-Card).
If you don't want to use any library at all you can also write very
simple "Ajax" code like this:
<script type="text/javascript"><!--
var http = null;
if( window.XMLHttpRequest ) {
http_data = new XMLHttpRequest();
} else {
http_data = new ActiveXObject( "Microsoft.XMLHTTP" );
}
function request_data () {
http_data.open( "GET", "/cgi-bin/data.cgi?T=1&X=2", true );
http_data.onreadystatechange = show_data;
http_data.send( null );
}
function show_data() {
if( http_data.readyState == 4 ) {
document.getElementById( "data" ).innerHTML = http_data.responseText;
}
}
-->
Just call request_data() to request any dynamic html code piece and
insert it in a <div> with the ID "data".
If you need support, just let us know...
Regards,
Ole Reinhardt
--
Thermotemp GmbH, Embedded-IT
Embedded Hard-/ Software and Open Source Development,
Integration and Consulting
http://www.embedded-it.de
Geschäftsstelle Siegen - Steinstraße 67 - D-57072 Siegen -
tel +49 (0)271 5513597, +49 (0)271-73681 - fax +49 (0)271 736 97
Hauptsitz - Hademarscher Weg 7 - 13503 Berlin
Tel +49 (0)30 4315205 - Fax +49 (0)30 43665002
Geschäftsführer: Jörg Friedrichs, Ole Reinhardt
Handelsregister Berlin Charlottenburg HRB 45978 UstID DE 156329280
More information about the En-Nut-Discussion
mailing list