Skip to content

Commit e25a6ba

Browse files
g2probhudson
authored andcommitted
Load jQuery from the DOM instead of document.write.
document.write doesn't work with xhtml. Signed-off-by: Rob Hudson <rob@cogit8.org>
1 parent f5f29e4 commit e25a6ba

File tree

1 file changed

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

1 file changed

+5
-1
lines changed

debug_toolbar/templates/debug_toolbar/base.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
var _$ = window.$;
77
if (typeof jQuery == 'undefined') {
88
var jquery_url = '{{ BASE_URL }}/__debug__/m/jquery.js';
9-
document.write(unescape('%3Cscript src="' + jquery_url + '" type="text/javascript"%3E%3C/script%3E'));
9+
var head = document.getElementsByTagName("head")[0];
10+
var script = document.createElement('script');
11+
script.type = 'text/javascript';
12+
script.src = jquery_url;
13+
head.appendChild(script);
1014
}
1115
/* ]]> */
1216
</script>

0 commit comments

Comments
 (0)