apps/LP page: cleanest way to execute Lua code on jQuery event? - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: apps/LP page: cleanest way to execute Lua code on jQuery event? (/showthread.php?tid=5172) |
apps/LP page: cleanest way to execute Lua code on jQuery event? - rbourgeon - 22.12.2023 Hi, I have made my first LP page that does stuff dynamically using JavaScript and jQuery, for instance load localbus.js.gz andÂ
but this JavaScript library "localbus" only allows to listen and to write on the values of the KNX objects. What if want to build a jQuery event handler that does something that would be easy to write in Lua? For instance:
I know that I can embed Lua code inside the LP page (with the <? ?> tags), but this Lua code is executed only when loading the page the first time. How would it be possible to execute Lua code on-demand when some event happens on the web page? RE: apps/LP page: cleanest way to execute Lua code on jQuery event? - admin - 23.12.2023 Use AJAX ($.get/$.post) to call a different .lp script. RE: apps/LP page: cleanest way to execute Lua code on jQuery event? - jmir - 26.03.2024 Hi admin, Can you post an example on how to call a .lp file from a .lp file to execute lua code? Thanks. RE: apps/LP page: cleanest way to execute Lua code on jQuery event? - admin - 26.03.2024 Add your common code to a user library instead. |