24.09.2019, 02:42
Is it possible to call a lua library function from custom javascript using a .lp file, i know we can retrieve data from the .lp script
many Thanks
many Thanks
.lp call lua library function
|
24.09.2019, 02:42
Is it possible to call a lua library function from custom javascript using a .lp file, i know we can retrieve data from the .lp script
many Thanks
24.09.2019, 04:58
You can call any function but you need to make sure that there are no blocking call because that will block the web server until function is executed. .lp can be loaded via XHR/AJAX call. What kind of function do you want to execute?
24.09.2019, 05:39
(This post was last modified: 24.09.2019, 05:40 by benanderson_475.)
Thanks,
I have something working now, If I have some lua lib function with parameters eg function do_cmd(cmd) return(“MV”.. cmd) end Can the parameter cmd be passed through the .lp From the js Or do I need separate .lp for each function call? Many thanks
24.09.2019, 06:07
You can pass parameters via GET or POST. You can retrieve values via getvar() function in .lp. See complete documentation for more info: https://forum.logicmachine.net/showthread.php?tid=85
jQuery docs on how to send data via POST: https://api.jquery.com/jQuery.post/#jQue...s-dataType |
« Next Oldest | Next Newest »
|