activa Posted July 25, 2015 Report Posted July 25, 2015 what is the best practice to laod js file to the header from the getPackageFields() function in module ? Quote
Tyson Posted July 25, 2015 Report Posted July 25, 2015 The package fields are loaded via AJAX, so there is no way for it to set javascript into the header. You can, however, set inline javascript by setting HTML on the ModuleFields object you return from that method. Quote
Blesta Addons Posted July 25, 2015 Report Posted July 25, 2015 try blestaSetHeadTag with this code . $fields->setHtml(" <script type=\"text/javascript\"> $(document).ready(function() { $(this).blestaSetHeadTag(\"script\", {type:\"text/javascript\", src: \"". $this->Html->safe( URL_TO _YOUR_JS_FILE) ."\"}); }); </script> "); i have used in a old project . Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.