diff options
| author | Aymeric Augustin | 2013-11-10 10:26:50 +0100 |
|---|---|---|
| committer | Aymeric Augustin | 2013-11-10 10:26:50 +0100 |
| commit | 2b6f5d6661dac283b7fb1cdfc6e252b6b6367d19 (patch) | |
| tree | 98f18c2b26bbdbfab0cdb2615e44cb53a1209953 | |
| parent | 53360b6c2685ac76ccf6e7f8ce7a032a001adf4e (diff) | |
| download | django-debug-toolbar-2b6f5d6661dac283b7fb1cdfc6e252b6b6367d19.tar.bz2 | |
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.
| -rw-r--r-- | debug_toolbar/templates/debug_toolbar/base.html | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/debug_toolbar/templates/debug_toolbar/base.html b/debug_toolbar/templates/debug_toolbar/base.html index 0a5d771..49edaf5 100644 --- a/debug_toolbar/templates/debug_toolbar/base.html +++ b/debug_toolbar/templates/debug_toolbar/base.html @@ -4,12 +4,7 @@ </style> <link rel="stylesheet" href="{{ STATIC_URL }}debug_toolbar/css/toolbar.min.css" type="text/css" /> <script> -if(!window.jQuery) { - var script = document.createElement('script'); - script.src = "{{ STATIC_URL }}debug_toolbar/js/jquery.js"; - var exist = document.getElementsByTagName('script')[0]; - exist.parentNode.insertBefore(script, exist); -} +if(!window.jQuery) document.write('<scr'+'ipt src="{{ STATIC_URL }}debug_toolbar/js/jquery.js"></scr'+'ipt>'); </script> <script src="{{ STATIC_URL }}debug_toolbar/js/jquery.cookie.js"></script> <script src="{{ STATIC_URL }}debug_toolbar/js/toolbar.js"></script> |
