[En-Nut-Discussion] EIR and java script

Bernd Walter enut at cicely.de
Wed Feb 3 01:17:53 CET 2010

On Sun, Jan 31, 2010 at 03:21:38PM +0100, Ulrich Prinz wrote:
> Hi Bernd!
> Yep, most things you wrote about ajax was clear to me. I thought there 
> where some small extensions to the protocol interpreter needed. But 
> however, most of the facts where the reason why I would prefer ajax. The 
> work is done by the client, the PC, and there is only little impact on 
> the server side, the EIR.

Exactly and if you store the pages on an SD card it is easy to
modify without changing the firmware.

> Bernd Walter schrieb:
> > On Sun, Jan 31, 2010 at 01:03:54PM +0100, Ulrich Prinz wrote:
> >> Hi András,
> >>
> >> looks like Ajax is sort of a 'simple' extension to java script and CGI 
> >> that already exists in Nut/OS. And it looks like what I prefer for my 
> >> EIR extension. I didn't find any option to submit a command to the 
> >> server (EIR) without submitting the complete form and clearing the page.
> > 
> > You can always catch and tune form updates in javascript.
> > With javascript it is also possible to just submit the data without
> > touching the displayed data at all or just update a partial page.
> > 
> Aaaargh! Yes, I thought that is possible... But I don't have any 
> complete book about java script and I googled and used the small 
> tutorials I found and none of them did tell me how to pass arguments to 
> the server without submitting the whole frame and needing to refresh the 
> page. So... please... could you tell me how? Ples give me line of 
> example code, a link where to read or may be two lines of code?

I'm not very good with javascript, so I can't help you with this myself.
Ajax itself is just a modern buzzword for a few javascript features.
Those are the ability to retrieve data from URLs and to modify
the page content.
I suggest you a good ajax book for the start.
Myself I have ISBN 9783826617621, which is a small inexpensive book
writen in German language and gives a good start with easy to understand
If you can read German I can suggest you this book.

> >> Can you hand me over that Ajax extension? I'd like to see it in Nut/OS 
> >> if you don't mind.
> > 
> > Ajax is a browser thing.
> > Nut/OS already has everything you need.
> > On EIR you only need to add application related CGI functions.
> > E.g. add a CGI which only delivers the table with the radio station list
> > and not a full HTML page.
> Aha... I am just reading about ajax and I already understood that it is 
> only necessary to pass parts of the data and the ajax is doing the rest.

Well - retiriving the data is simple.
More difficult is to learn which Javascript functions are available
to modify the displayed pagedata.
People also use it a lot to animate things, e.g. shading out object data
by periodicly changing colors, sizes etc...
JQuery and Mootools help a lot to simplify this task, but those are
easier to understand once you know the technology behind.

B.Walter <bernd at bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.

More information about the En-Nut-Discussion mailing list