Hi,
Just wondering what the trick is to run the web socket RunFunction function?
I have a function on my HTML page like:
When I run my HTML code it will alert 'testing' since it's calling that function on page load, which is fine while I am testing it.
In my B4J app I am trying to call this function using a web socket like:
The problem I have is when I run the app it comes up with the error:
From what I understand there is too many parameters in the RunFunction function part in my code.
I tried doing:
Now when I run the app it says:
How can I trigger the JavaScript Function from a web Socket, is this the correct way in doing it ?
Just wondering what the trick is to run the web socket RunFunction function?
I have a function on my HTML page like:
HTML:
<script>
jQuery(document).ready(function() {
test();
});
function test(){
alert("testing");
}
</script>
When I run my HTML code it will alert 'testing' since it's calling that function on page load, which is fine while I am testing it.
In my B4J app I am trying to call this function using a web socket like:
B4X:
Sub btnCalc_Click (Params As Map)
ws.RunFunction("test", Null)
End Sub
The problem I have is when I run the app it comes up with the error:
B4X:
Parsing code. 0.05
Compiling code. Error
Error compiling program.
Error description: Too many parameters.
Occurred on line: 24
ws.RunFunction("test", Null)
Word: _c
From what I understand there is too many parameters in the RunFunction function part in my code.
I tried doing:
B4X:
Sub btnCalc_Click (Params As Map)
ws.RunFunction("test")
End Sub
Now when I run the app it says:
B4X:
Parsing code. 0.03
Compiling code. Error
Error compiling program.
Error description: Missing parameter.
Occurred on line: 24
ws.RunFunction("test")
Word: )
How can I trigger the JavaScript Function from a web Socket, is this the correct way in doing it ?