ftd
functionHere is an example of how you can integrate JavaScript in ftd functions.
Suppose we have a JavaScript functionshow_alert
defined in functions.js
as follows:functions.js
function show_alert(a) { alert(a); }
index.ftd
:index.ftd
-- ftd.text: Click here to print name in alert! $on-click$: $call-js-fn(a = FifthTry Alert) -- void call-js-fn(a): string a: js: functions.ftd show_alert(a)
call-js-fn
function is called, passing the FifthTry
value to the argument a
. This function, then, references functions.js
by using the js
attribute and calls the show_alert
function.Have a question or need help?
Visit our GitHub Q&A discussion to get answers and subscribe to it to stay tuned.
Join our Discord channel and share your thoughts, suggestion, question etc.
Connect with our community!We welcome you to join our Discord community today.
We are trying to create the language for human beings and we do not believe it would be possible without your support. We would love to hear from you.