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 ?
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.
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 .
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now