How call JavaScript function from C
I want to call javascript function in *.js file from C
example hello.js, containing func1, func2, In C function, How do I call func1 in C files?
In this case, how can i export all js functions to object for calling in C code?
@zhaojuntao you can get your function objects with jerry_get_property, then you can call them with jerry_call_function
@LaszloLango
That means I just need to read the script source , then jerry_parse and jerry_run , finally i can use jerry_get_property to get js file` function objects, then call and execute it.
Is that right? THANKS
@zhaojuntao yes
@LaszloLango Thanks ! I have got it, code is passed.