You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the async attribute of the `<script>` element to load the scripts
asynchronously.
From https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-async
> ..., if the async attribute is present, then the classic script will
> be fetched in parallel to parsing and evaluated as soon as it is
> available.
>
> ...
>
> This attribute allows the elimination of parser-blocking JavaScript
> where the browser would have to load and evaluate scripts before
> continuing to parse.
IMO, async is preferable to defer for two reasons,
1. Scripts with the defer attribute will prevent the DOMContentLoaded
event from firing until the script has loaded and finished evaluating.
The django-debug-toolbar scripts should not block this event. This is
now avoided by checking the document state before calling djdt.init().
2. The defer attribute has no effect on module scripts. Now that
JavaScript modules are in the ES6 spec and available in modern supported
browsers, django-debug-toolbar can begin moving towards use them which
offer many advantages over the classical `<script>` element. Upon moving
to modules, the scripts should continue to load asynchronously.
<h2>{% trans "Location:" %} <aid="redirect_to" href="{{ redirect_to }}">{{ redirect_to }}</a></h2>
9
10
<pclass="notice">
10
11
{% trans "The Django Debug Toolbar has intercepted a redirect to the above URL for debug viewing purposes. You can click the above link to continue with the redirect as normal." %}
0 commit comments