Hi Mircea,
what we are doing in our projects to load data via javascript is the following:
1. Create a handler for you commands in "fnHandleWeb" in webInterface.c
if(uMemcmp(ptrData,"#yourCmd",8) == 0){
return fnHandleDynamicQuery(ptrData, http_session);
}
This will check if the string after the / in the URL is "#yourCmd" (e.g. 192.168.0.1/#yourCmd)
The # sign is there because there is no webPage starting with this char.
2. Set up the handler:
char fnHandleDynamicQuery(CHAR *ptrData, HTTP *http_session){
char buff[BUFF_SIZE] = {0}; //create a buffer with specified size
uMemset(buff,0,BUFF_SIZE); //empty the buffer
//fill the buffer here with the data you would like to display
//set the Buffer as file to be displayed
http_session->ptrFileStart = (unsigned char*)buff;
http_session->ucMimeType = MIME_HTML; // force HTML type
http_session->cDisplayFile = 0;
http_session->FileLength = len; //len is the length of the data you inserted into the buffer
return DISPLAY_INTERNAL;
}
3. Get the code with Javascript in your webpage (keyword: XMLHttpRequest)
I hope this helps you
Regards
Paul