Skip to content

Commit 62b2e37

Browse files
load jQuery with document.createElement instead of document.write
to satisfy integration test
1 parent ea8a6d7 commit 62b2e37

File tree

1 file changed

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

1 file changed

+8
-1
lines changed

debug_toolbar/templates/debug_toolbar/base.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
@media print { #djDebug {display:none;}}
44
</style>
55
<link rel="stylesheet" href="{{ STATIC_URL }}debug_toolbar/css/toolbar.min.css" type="text/css" />
6-
<script>window.jQuery || document.write('<script src="{{ STATIC_URL }}debug_toolbar/js/jquery.js"><\/script>')</script>
6+
<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+
}
13+
</script>
714
<script src="{{ STATIC_URL }}debug_toolbar/js/jquery.cookie.js"></script>
815
<script src="{{ STATIC_URL }}debug_toolbar/js/toolbar.js"></script>
916
<div id="djDebug" style="display:none;" dir="ltr" {{ TOOLBAR_ROOT_TAG_ATTRS|safe }}>

0 commit comments

Comments
 (0)