B4J Question websocket app hello world send response to funtcion

Jose Cadenas

Member
Licensed User
Longtime User
i can send response to one function

Sub btnCalc_Click (Params AsMap)
Dim ft2 AsFuture = text2.GetVal
Dim ft1 AsFuture = text1.GetVal
If IsNumber(ft1.Value) AND IsNumber(ft2.Value) Then
function response('hola mundo')
Else
function response('X')
End If
End Sub

<script>
//connect to the web socket when the pageis ready.
$( document ).ready(function() {
b4j_connect("/ws");});

function response(resp){
if (resp=='X'){
.....................................
}else{
alert(resp);
.....................................
}
}
</script>

reference:
https://www.b4x.com/android/forum/threads/webapp-hello-world-web-app.39808/#content

thank you for you help
 
Top