Author: andrei_exadel
Date: 2008-08-19 12:01:38 -0400 (Tue, 19 Aug 2008)
New Revision: 10142
Modified:
trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
Log:
Fix script evaluation
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-08-19 15:40:42 UTC
(rev 10141)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-08-19 16:01:38 UTC
(rev 10142)
@@ -363,6 +363,7 @@
// need to check for firstChild due to opera 8 bug with hasChildNodes
Sarissa.clearChildNodes(oldnode);
importednode = window.document.importNode(newnode, true);
+ //importednode.innerHTML = importednode.innerHTML;
LOG.debug("Replace content of node by replaceChild()");
anchor.replaceChild(importednode,oldnode);
}
@@ -840,6 +841,7 @@
A4J.AJAX.headElementsCounter = 0;
A4J.AJAX.processResponse = function(req) {
+ A4J.AJAX.TestScriptEvaluation();
var options = req.options;
var ajaxResponse = req.getResponseHeader('Ajax-Response');
// If view is expired, check user-defined handler.
@@ -1506,9 +1508,9 @@
//Test for re-evaluate Scripts in updated part. Opera & Safari do it.
A4J.AJAX._scriptEvaluated=false;
-if (!document.all || window.opera){
- setTimeout(function(){
- try{
+A4J.AJAX.TestScriptEvaluation = function () {
+if ((!document.all || window.opera) && !A4J.AJAX._scriptTested){
+ try{
// Simulate same calls as on XmlHttp
var oDomDoc = Sarissa.getDomDocument();
var _span = document.createElement("span");
@@ -1526,5 +1528,6 @@
}
} catch(e){ /* Mozilla in XHTML mode not have innerHTML */ };
- },0);
}
+A4J.AJAX._scriptTested = true;
+}
Show replies by date