Skip to content

Commit 2b6f5d6

Browse files
committed
The smart way didn't work, keep it simple.
When jQuery wasn't loaded yet, the <script> tag was inserted properly, but jQuery wasn't loaded before jquery.cookie.js and toolbar.js. As a consequence these scripts crashed. Refs #440.
1 parent 53360b6 commit 2b6f5d6

File tree

1 file changed

+1
-6
lines changed
  • debug_toolbar/templates/debug_toolbar

1 file changed

+1
-6
lines changed

debug_toolbar/templates/debug_toolbar/base.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44
</style>
55
<link rel="stylesheet" href="{{ STATIC_URL }}debug_toolbar/css/toolbar.min.css" type="text/css" />
66
<script>
7-
if(!window.jQuery) {
8-
var script = document.createElement('script');
9-
script.src = "{{ STATIC_URL }}debug_toolbar/js/jquery.js";
10-
var exist = document.getElementsByTagName('script')[0];
11-
exist.parentNode.insertBefore(script, exist);
12-
}
7+
if(!window.jQuery) document.write('<scr'+'ipt src="{{ STATIC_URL }}debug_toolbar/js/jquery.js"></scr'+'ipt>');
138
</script>
149
<script src="{{ STATIC_URL }}debug_toolbar/js/jquery.cookie.js"></script>
1510
<script src="{{ STATIC_URL }}debug_toolbar/js/toolbar.js"></script>

0 commit comments

Comments
 (0)