zsiciarz / django-markitup

Markup handling (using Jay Salvat's MarkItUp! flexible universal markup editor) for Django
https://github.com/zsiciarz/django-markitup
BSD 3-Clause "New" or "Revised" License
47 stars 31 forks source link

Inline js makes it impossible to load form media js in page foot #25

Open stefanor opened 6 years ago

stefanor commented 6 years ago

For performance, it's usually recommended to render CSS in HTML head and JS in the foot of the page. That way only the CSS loading needs to happen before rendering the page, and the JS can execute once it is visible. (Assuming the page doesn't need the JS to complete to generate content).

Markitup's inline JS requires both jQuery and markitup to be loaded above the widget, in the page.

I would suggest rather having data attributes inline, and adding a single script to the widget's media that consumes these configures the widget.