W wl Well-Known Member Licensed User Longtime User Feb 14, 2015 #1 Hi, I have gathered the necessary server and client code to use websockets. But I'm missing some instructions on how it works in a browser ? There used to be a chat demo but it is no longer available ? Tx
Hi, I have gathered the necessary server and client code to use websockets. But I'm missing some instructions on how it works in a browser ? There used to be a chat demo but it is no longer available ? Tx
Erel B4X founder Staff member Licensed User Longtime User Feb 15, 2015 #2 All the demos are available: https://www.b4x.com/android/forum/threads/webapp-web-apps-overview.39811/ And online: http://b4x.com:51042/ Upvote 0
All the demos are available: https://www.b4x.com/android/forum/threads/webapp-web-apps-overview.39811/ And online: http://b4x.com:51042/
W wl Well-Known Member Licensed User Longtime User Feb 17, 2015 #3 Erel, As far as websockets in a browser is concerned. Would it mean that something like the following works: Server-side: Code: Copy ws.RunFunction("myFunction", SomeArrayOfStrings) Browser-side: Code: Copy function myFunction() { var i; for (i = 0; i < arguments.length; i++) { ... arguments[i] ... 'is each item in the SomeArrayOfStrings I defined server-side. } } Would I need to pass an array of strings, a list of string, or would both work out ? Thanks ! Upvote 0
Erel, As far as websockets in a browser is concerned. Would it mean that something like the following works: Server-side: Code: Copy ws.RunFunction("myFunction", SomeArrayOfStrings) Browser-side: Code: Copy function myFunction() { var i; for (i = 0; i < arguments.length; i++) { ... arguments[i] ... 'is each item in the SomeArrayOfStrings I defined server-side. } } Would I need to pass an array of strings, a list of string, or would both work out ? Thanks !
Erel B4X founder Staff member Licensed User Longtime User Feb 18, 2015 #4 Both will work. You can also pass numbers or other types of variables. Upvote 0