Discussion:
[TYPO3-english] Simple chat on extbase. How to get messages without reload page?
Dmitry
2017-10-22 15:58:44 UTC
Permalink
I'm doing an extension for a simple chat on extbase. For sending message I'm using ajax request with pagetype like

<!-- Here showing new messages -->
<div class="comments"></div>

<!-- Form for send message -->
<f:form pageType="1337" class="ajaxpost"...

As a result everything works fine. Sender can post messages without reloading page. But how make to sender can read messages from recipient without reload page. Or if I know what I have new mesage, page must be reload? Any idea or direction.
--
Kind regards,
Dmitry Vasilev
www: http://typo3.ru.net/
Skype: thule-varahi;
Phone: +7 950 001 85 15
Mikel
2017-10-23 08:58:59 UTC
Permalink
Hi Dmitry,

You have to develop that also by JavaScript or implement a push service.

In TYPO3, you need to develop an action, which returns the messages from a single chat.
In JavaScript, you need to develop the logic, which gets this messages by an Ajax request. E.g. with a JS timeout.

That would be the basic version, as you have to make your request for new chat messages by a JS timeout, which is not an ideal solution.
For a more prossessional solution, you can implement a PHP push service. E.g. Scaledrone or Pusher. With such a service, you can trigger the procedure, after a message was submitted to the server.

Hope, that helps to point you in the right direction…

Mikel
Post by Dmitry
I'm doing an extension for a simple chat on extbase. For sending message I'm using ajax request with pagetype like
<!-- Here showing new messages -->
<div class="comments"></div>
<!-- Form for send message -->
<f:form pageType="1337" class="ajaxpost"...
As a result everything works fine. Sender can post messages without reloading page. But how make to sender can read messages from recipient without reload page. Or if I know what I have new mesage, page must be reload? Any idea or direction.
--
Kind regards,
Dmitry Vasilev
www: http://typo3.ru.net/
Skype: thule-varahi;
Phone: +7 950 001 85 15 _______________________________________________
TYPO3-english mailing list
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
Loading...