summaryrefslogtreecommitdiffstats
path: root/swat
diff options
context:
space:
mode:
authorDeryck Hodge <deryck@samba.org>2005-08-26 21:58:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:34:38 -0500
commitbcc288d880e4e76154da66c9eb4a8e25367bfc6c (patch)
treec750cda1c784087964e5ef25d22ffac9c3838e8b /swat
parent25c39426237f5a26de9d80b97a1c7225202d1584 (diff)
downloadsamba-bcc288d880e4e76154da66c9eb4a8e25367bfc6c.tar.gz
samba-bcc288d880e4e76154da66c9eb4a8e25367bfc6c.tar.xz
samba-bcc288d880e4e76154da66c9eb4a8e25367bfc6c.zip
r9668: Cross-browser fix for IE, when adding scripts on the fly.
deryck (This used to be commit 1f4e65ce96ec8c4335bfabbe54989a8cb431d773)
Diffstat (limited to 'swat')
-rw-r--r--swat/scripting/client/js_scripts.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/swat/scripting/client/js_scripts.js b/swat/scripting/client/js_scripts.js
index 776e5e4ded..1c6e5806f4 100644
--- a/swat/scripting/client/js_scripts.js
+++ b/swat/scripting/client/js_scripts.js
@@ -32,10 +32,17 @@ function __get_js_script(file)
function __add_js_script(path)
{
+ // Create a unique ID for this script
+ var srcID = new Date().getTime();
+
var script = document.createElement('script');
- script.setAttribute('type', 'text/javascript');
- script.setAttribute('src', path);
+ script.type = 'text/javascript';
+ script.id = srcID;
+
head.appendChild(script);
+
+ // IE works only with the path set after appending to the document
+ document.getElementById(srcID).src = path;
}
function __remove_js_script(path)