I’m having a look at JavaScript as I am investigating creating a web app with React, and would like to communicate with my Delphi DA server. I’ve started with the chat sample and failed at the first hurdle! As I try to use it, I get an error. If I run the sample from \RemObjects Samples\RemObjects SDK for Delphi\HTTP Chat, and using Chrome go to http://localhost:8099/js/ then I can login OK, but as soon as I try a message, I get:
Error: JSONMessage.setResponseStream:
JSON parsing error: Unexpected token R in JSON at position 0
Server response:
RO107D/ZÆÎEög"7ùLHTTPChatEvents
OnSendMessageuser60ee
Call stack:
I presume for my own app, I should be able to export the codegen generated js interface file and it should work?
Doh ! What an idiot I am! That would be a no,
Thanks.
Are there any useful things I should know, like a React sample or a nice way to do things like Fire creating the DataAccess class or limitations of the current JS DA? I’m just reading the docs of course.
I wonder if you could take a look at this for me? I thought it would be nice to add a react client for the http chat sample of yours, so I have done this but notice that I am missing something as it doesn’t use the same session each time it sends a message, so the user is unknown each time, and this is different to the existing js sample you’ve made which works fine and I can’t work out what I’ve not got right here. RO React Chat Sample.zip (427.3 KB)
Thanks
Of course, thanks Eugene, I’ve got it right now! As I say, I’m just working out how this React stuff fits together (not to mention learning JavaScript as well).