Einzelnen Beitrag anzeigen

mjustin

Registriert seit: 14. Apr 2008
3.005 Beiträge
 
Delphi 2009 Professional
 
#7

AW: Delphi and indy

  Alt 8. Okt 2014, 17:15

do i have to use TIDHTTP and get message in webpage ?

i usuaily do this with after sending the message

MeMoTEXT.Lines.Add(MSG); i cant do same with Embedded WB ?
No, you can not use Memo Lines in a web browser. A web browser renders HTML and optionally processes JavaScript.

You need a HTML page which is generated and updated automatically when a new chat message arrives.

So you need a HTTP server (for example TIdHTTPServer), and a good knowledge of HTML.

The dynamic HTML content can use animated icons of course. The main problem however is how the HTML page is refreshed when new messages arrive.

I recommend to start with a simple prototype, using a JavaScript framework like jQuery, to build a first basic chat app. The basic chat page would contain one public chat room where all messages can be seen by all users.

New chat messages can be added as new elements in the HTML document tree. With jQuery, you can delete and append HTML elements very easy, so the client side would only contain some lines of JavaScript.

The server needs to build th new HTML elements and serve them to the jQuery script. This is where long polling comes into the play, see my linked article.
Michael Justin
  Mit Zitat antworten Zitat