I am porting a WebApp(Javascript) -> PHP -> MySQL system to WebApp(Javascript) -> jServer-> MySQL.
I have no problems with the jServer-> MySQL part.
I would prefer to use a socket handler class as opposed to a request/response handler class but that is not really important.
I want to simply send an ID and get the data value back, preferably as text.
Questions:
1. Do I need to create an index.html file in the 'www' folder to do this? And what does it contain? There is no UI. (I am looking at the Server Example)
2. How do I structure my Ajax call and how do I receive a POST or GET on the server?
I have looked at many examples but they are all B4X -> B4J.
I thought it would be something simple like the 'Action' handler in the CloudKVS example but I don't seem to be able to connect. What should my URL look like?
All server permissions and authentication systems are working fine.
Any push in the right direction would be much appreciated.
I should have checked the Chrome console.logs before asking the question.
It seems I am AM getting the data.
The problem is not a B4X problem.
I am getting a json parsing error in the Ajax returnFunction which I need to figure out.
"SyntaxError Unexpected token { in JSON at position 283"
I tried converting my text data to base64 before generating the json but the error is the same so, I don't believe, it is not the data that is at fault.
1. Create a list
2. Iterate through all Results of the reultset.
2b. Create a Map for one Result of the resultset. Add the Map to the list.
3. After the iteration. generate a json from the list holding the maps.