aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel2010-01-22 15:59:05 +0100
committerRob Hudson2010-01-22 07:23:47 -0800
commite25a6ba55b437091ab8d5d801d6f3ef227d92d95 (patch)
treef6f38b5cc06aad89bba0525f4fb6c4c102f32fd7
parentf5f29e4577fc34cb4e7b44232f36ad6e2a1b0eb9 (diff)
downloaddjango-debug-toolbar-e25a6ba55b437091ab8d5d801d6f3ef227d92d95.tar.bz2
Load jQuery from the DOM instead of document.write.
document.write doesn't work with xhtml. Signed-off-by: Rob Hudson <rob@cogit8.org>
-rw-r--r--debug_toolbar/templates/debug_toolbar/base.html6
1 files changed, 5 insertions, 1 deletions
diff --git a/debug_toolbar/templates/debug_toolbar/base.html b/debug_toolbar/templates/debug_toolbar/base.html
index c7e930b..50c0be0 100644
--- a/debug_toolbar/templates/debug_toolbar/base.html
+++ b/debug_toolbar/templates/debug_toolbar/base.html
@@ -6,7 +6,11 @@
var _$ = window.$;
if (typeof jQuery == 'undefined') {
var jquery_url = '{{ BASE_URL }}/__debug__/m/jquery.js';
- document.write(unescape('%3Cscript src="' + jquery_url + '" type="text/javascript"%3E%3C/script%3E'));
+ var head = document.getElementsByTagName("head")[0];
+ var script = document.createElement('script');
+ script.type = 'text/javascript';
+ script.src = jquery_url;
+ head.appendChild(script);
}
/* ]]> */
</script>