Include js from file

achartier

Administrator
Staff member
I know we can include js in the form_xx.js file but I would like to be able to point to a specific js file much like we do for php files for form and element php. Is there any reason this is not an option?

I imagine this would not be hard to do and would be willing to write the code to do it. Is there any reason this would not be possible or useful?

Thx.
 
The way I usually do it is with a PHP plugin, running onLoad, and do ...

Code:
FabrikHelperHTML::script('relative/path/to/script.js', 'optional(javascript).code().to().run().on().script(load);');

This adds your script into our RequireJS loading mechanism, so it'll work in regular page loads, and in AJAX based popups.

I've thought about adding this as an option on forms, lists and vizs, and basically deprecate the form_X.js mechanism, just never gotten round to it.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top