DMKEBUSINESSGMBH / typo3-mkforms

https://www.dmk-ebusiness.de
3 stars 6 forks source link

Include the JavaScript in the BODY instead of in the HEAD #52

Open oliverklee opened 7 years ago

oliverklee commented 7 years ago

The JavaScript should be included in the bottom of the BODY, not in the HEAD. This is for two reasons:

  1. The loading/parsing of the HTML after the JavaScript is blocked until the JavaScript is loaded and executed. So it is recommended to put the JavaScript last thing in the BODY so that the page can be displayed quicker.
  2. mkforms will break if other extensions provide jQuery and include it the BODY (as recommended) instead of in the HEAD.

In TYPO3, jQuery & Prototype should be included with page.includeJSFooterlibs, and non-library mkforms stuff be included with page.includeJSFooter: https://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Page/Index.html

hannesbochmann commented 7 years ago

Feel free to provide a pull request. We don't have free time for this right now.