Javascript code not working on Web View Evaluator

I have tried several ways to make this code work but it always gives “null” as output, the strange is that I tested on jsfiddle online and it working fine, is there some sintaxis that makes it not work on Kodular?

The way this work is that you define 2 variables (numbers) and it divides number “a” into “b” parts and gives that output that I assign to a text box after get the result.

JS Code:
https://jsfiddle.net/magicDev/syjrgcq0/

I tried a lot of variants, like defining function first, changing the output format, etc. None of them works in Kodular.

As you can see, the code works fine on the fiddle console

Isn’t??? But see i got the output…

Try to evaluate on button click instead of screen initialise

I was using “After JS Evaluated” instead of “On Console Message”.

I tried the way you show and it gives me “Uncaught SyntaxError: Unexpected end of input”.

Anyway, in your picture the output is 545? it should be the row of numbers that is showed in the console in the last picture

All I get is null, someone knows what is wrong? I´m trying with WebViewTools just to try something else

Ok finally, I found the silly solution, I was pasting the code with the comments in between and this was generating error.

I deleted the //comments and now is working :melting_face:
should be great for kodular a specific box to paste JS code…

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.