Hello everybody,
I want to run a Javascript function that I introduced by ws.Eval into the server, by clicking a button on the html page that I captured in the app as JQueryElement.
So I want the function to run in the click event of the button in server app as shown in the code section. However, it does not with an error in the console that states:
Uncaught TypeError: Cannot read properties of undefined (reading 'apply')
at b4j_runFunction (b4j_ws.js:51)
at WebSocket.b4j_ws.onmessage (b4j_ws.js:79)
The code:
Any mastemind could expalin that.. I will be grateful
Regards
I want to run a Javascript function that I introduced by ws.Eval into the server, by clicking a button on the html page that I captured in the app as JQueryElement.
So I want the function to run in the click event of the button in server app as shown in the code section. However, it does not with an error in the console that states:
Uncaught TypeError: Cannot read properties of undefined (reading 'apply')
at b4j_runFunction (b4j_ws.js:51)
at WebSocket.b4j_ws.onmessage (b4j_ws.js:79)
The code:
B4X:
.
Private sub somefunc()
.
.
Dim code As String = $"
function hi(str){
alert(str);
}
"$
ws.Eval(code,Null)
.
.
.
End sub
Private Sub btn_Click (Params As Map)
ws.RunFunction("hi", Array As String("Hello"))
ws.Flush
End Sub
Any mastemind could expalin that.. I will be grateful
Regards