Author: scottbw
Date: Thu Jan 12 20:13:51 2012
New Revision: 1230752

URL: http://svn.apache.org/viewvc?rev=1230752&view=rev
Log:
Get JQuery to use CORS if available; this prevents "no transport" errors on 
Opera. Also added a debug for Ajax errors - FIXME replace this with some proper 
error handling

Modified:
    incubator/wookie/trunk/widgets/templates/browse/scripts/browse_controller.js

Modified: 
incubator/wookie/trunk/widgets/templates/browse/scripts/browse_controller.js
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/widgets/templates/browse/scripts/browse_controller.js?rev=1230752&r1=1230751&r2=1230752&view=diff
==============================================================================
--- 
incubator/wookie/trunk/widgets/templates/browse/scripts/browse_controller.js 
(original)
+++ 
incubator/wookie/trunk/widgets/templates/browse/scripts/browse_controller.js 
Thu Jan 12 20:13:51 2012
@@ -147,14 +147,17 @@ $('div.result').live('expand', function(
  */
 ${widget.shortname}_browse_controller.transform = function(src, type){
  var output = "";
-
+ $.support.cors = true; // force cross-site scripting (as of jQuery 1.5)
  $.ajax({
   url: src,
   dataType: "xml",
   async: false,
   success: function(xml){
     output = ${widget.shortname}_browse_controller.transformXml(xml, type); 
-  }
+  }, //end success function
+    error: function(xhr, textStatus, errorThrown) {
+        alert(errorThrown);
+    }
  });
  
  return output;


Reply via email to