jinyistudio Well-Known Member Licensed User Longtime User Aug 24, 2016 #1 Hi I could pass Map data from browser to server as following. browser side B4X: b4j_raiseEvent("archer_click", {"name": id,"event":evnt}); server side B4X: Sub archer_click(Params As Map) Dim id As String=Params.Get("name") Dim event As String=Params.get("event") Log(id & "," & event) End If End Sub How could i pass a MAP from server to browser ?
Hi I could pass Map data from browser to server as following. browser side B4X: b4j_raiseEvent("archer_click", {"name": id,"event":evnt}); server side B4X: Sub archer_click(Params As Map) Dim id As String=Params.Get("name") Dim event As String=Params.get("event") Log(id & "," & event) End If End Sub How could i pass a MAP from server to browser ?
Erel B4X founder Staff member Licensed User Longtime User Aug 24, 2016 #2 Are you using ws.RunFunction? You can put maps inside the list. Upvote 0
jinyistudio Well-Known Member Licensed User Longtime User Aug 24, 2016 #3 Yes,I am using ws.RunFunction. But I don't know how to access MAP in browser side with javascript. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Aug 24, 2016 #4 Example: js: B4X: function test(par) { console.log(par.a + ", " + par.b); } B4J: B4X: ws.RunFunction("test", Array(CreateMap("a": 1, "b": 2))) Use FireBug to see the output. Upvote 0
Example: js: B4X: function test(par) { console.log(par.a + ", " + par.b); } B4J: B4X: ws.RunFunction("test", Array(CreateMap("a": 1, "b": 2))) Use FireBug to see the output.
jinyistudio Well-Known Member Licensed User Longtime User Oct 31, 2016 #5 Hi Above is using WebSocket to pass map. How do i call javascript function(GET request) from browser and then recive map from b4j server(with AddHandler) ? Last edited: Oct 31, 2016 Upvote 0
Hi Above is using WebSocket to pass map. How do i call javascript function(GET request) from browser and then recive map from b4j server(with AddHandler) ?
Erel B4X founder Staff member Licensed User Longtime User Nov 1, 2016 #6 You should start a new thread for a new question. Upvote 0