activa Posted July 25, 2015 Report Share Posted July 25, 2015 what is the best practice to laod js file to the header from the getPackageFields() function in module ? Quote Link to comment Share on other sites More sharing options...
Tyson Posted July 25, 2015 Report Share 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 Link to comment Share on other sites More sharing options...
Blesta Addons Posted July 25, 2015 Report Share 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 Link to comment Share on other sites More sharing options...
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.