[seam-commits] Seam SVN: r8685 - trunk/src/remoting/org/jboss/seam/remoting.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Aug 13 17:54:45 EDT 2008


Author: shane.bryzak at jboss.com
Date: 2008-08-13 17:54:45 -0400 (Wed, 13 Aug 2008)
New Revision: 8685

Modified:
   trunk/src/remoting/org/jboss/seam/remoting/remote.js
Log:
JBSEAM-3261

Modified: trunk/src/remoting/org/jboss/seam/remoting/remote.js
===================================================================
--- trunk/src/remoting/org/jboss/seam/remoting/remote.js	2008-08-13 18:27:29 UTC (rev 8684)
+++ trunk/src/remoting/org/jboss/seam/remoting/remote.js	2008-08-13 21:54:45 UTC (rev 8685)
@@ -667,7 +667,32 @@
       if (inScope) Seam.Remoting.log("Response packet:\n" + req.responseText);
 
       if (callback)
-        callback(req.responseXML);
+      {
+        // The following code deals with a Firefox security issue.  It reparses the XML
+        // response if accessing the documentElement throws an exception
+        try
+        {         
+          req.responseXML.documentElement;
+          callback(req.responseXML);
+        }
+        catch (ex)
+        {
+           try
+           {
+             // Try it the IE way first...
+             var doc = new ActiveXObject("Microsoft.XMLDOM");
+             doc.async = "false";
+             doc.loadXML(req.responseText);
+             callback(doc);
+           }
+           catch (e)
+           {
+             // If that fails, use standards
+             var parser = new DOMParser();
+             callback(parser.parseFromString(req.responseText, "text/xml"));
+           }
+        }
+      }
     }
     else
       alert("There was an error processing your request.  Error code: " + req.status);




More information about the seam-commits mailing list