From e25a6ba55b437091ab8d5d801d6f3ef227d92d95 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Fri, 22 Jan 2010 15:59:05 +0100 Subject: Load jQuery from the DOM instead of document.write. document.write doesn't work with xhtml. Signed-off-by: Rob Hudson --- debug_toolbar/templates/debug_toolbar/base.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); } /* ]]> */ -- cgit v1.2.3