B4J Question [BANano] [SOLVED] How to BANano your way around inline-sub Javascript?

Mashiane

Expert
Licensed User
Longtime User
Hi there

I'm learning more about the BANano object and its usage. I read somewhere that executing Eval is kinda slow but then again, I haven't had any thing to take home about on it.

it just seems to be more easier to write..

B4X:
BANano.Eval("Chartkick.CustomChart = function (element, dataSource, options) {};")

of rather

B4X:
coptions.Put("download", Download)
    'define the format the data will be plotted on the chart
    #if javascript
        Chartkick.CustomChart = function (element, dataSource, options) {};
    #end if
    Dim bo As BANanoObject

however for one to understand BANano and thus the BANanoObject for example, one needs to be clear in terms of

1. what the javascript code does and will look like and secondly
2. how to write BANano code that will produce the correct javascript code for ones app to work.

So with the code above, what is recommended rather, execute eval / #if javascript / write banano code to produce similar javascript code? The reason Im asking is im learning and would like to know best scenarios just to write "inline" scripts?

Thanks!
 
Top