Author: eallen
Date: 2009-08-12 13:53:59 -0400 (Wed, 12 Aug 2009)
New Revision: 3560
Modified:
mgmt/trunk/wooly/resources/wooly.js
Log:
Change test for IE from node.outerHTML to document.all. Safari now implements outerHTML
and this causes it to hang when loading HTML from an ajax call.
Allow HTML returned from an ajax call to contain and execute javascript.
Modified: mgmt/trunk/wooly/resources/wooly.js
===================================================================
--- mgmt/trunk/wooly/resources/wooly.js 2009-08-12 17:48:02 UTC (rev 3559)
+++ mgmt/trunk/wooly/resources/wooly.js 2009-08-12 17:53:59 UTC (rev 3560)
@@ -206,7 +206,7 @@
var node = copyNode(newNode, true);
oldNode.parentNode.replaceChild(node, oldNode);
- if (node.outerHTML) {
+ if (document.all) {
// Damn you straight to hell, IE!
node.outerHTML = node.outerHTML;
}
@@ -275,6 +275,18 @@
return newElem;
}
+ function executeJS(node) {
+ var child = node.firstChild;
+ while (child) {
+ if (child.nodeType == 1 && child.nodeName == "script") {
+ var oScript = document.createElement("script");
+ oScript.text = child.textContent;
+
document.getElementsByTagName("head").item(0).appendChild(oScript);
+ }
+ child = child.nextSibling;
+ }
+ }
+
function getNewRequest() {
var request;
@@ -348,6 +360,8 @@
} else {
wooly.log("Element '" + id + "' not
found");
}
+ // find and execute any javascript
+ executeJS(child);
}
child = child.nextSibling;
Show replies by date