svn commit: samba r9668 - in branches/SAMBA_4_0/swat/scripting/client: .

deryck at samba.org deryck at samba.org
Fri Aug 26 21:58:57 GMT 2005


Author: deryck
Date: 2005-08-26 21:58:57 +0000 (Fri, 26 Aug 2005)
New Revision: 9668

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9668

Log:
Cross-browser fix for IE, when adding scripts on the fly.

deryck

Modified:
   branches/SAMBA_4_0/swat/scripting/client/js_scripts.js


Changeset:
Modified: branches/SAMBA_4_0/swat/scripting/client/js_scripts.js
===================================================================
--- branches/SAMBA_4_0/swat/scripting/client/js_scripts.js	2005-08-26 21:18:39 UTC (rev 9667)
+++ branches/SAMBA_4_0/swat/scripting/client/js_scripts.js	2005-08-26 21:58:57 UTC (rev 9668)
@@ -32,10 +32,17 @@
 
 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)



More information about the samba-cvs mailing list