A suggestion: include JavaScript files in footer
-
Hello,
I found out that the plugin includes JS files in head instead of footer. Is there any reason for this?
For performance reasons, I prefer to load JS files in footer, so I changed plugin code to allow JS files inclusion in footer and it seems that there are no issues, everything works fine. One only needs to give wp_register_script extra parameters.
The only JS file that had to be included in head is flickrJustifiedGalleryWPPlugin.js, but I would suggest to drop this file completely and simply put
echo <script>var jQueryFJGWPP = jQuery;</script>in a function hooked to wp_head hook. Does the same and spares some bandwidth 😉All the best,
Česlav
The topic ‘A suggestion: include JavaScript files in footer’ is closed to new replies.