cancel
Showing results for 
Search instead for 
Did you mean: 

[Solved]Ajax – empty responseText on GET

stevegreenbaum
Champ in-the-making
Champ in-the-making
I am calling a web script via Ajax and I am expecting a response from the Freemarker HTML template, but the responseText is always empty and the return.status = 0. readyState = 4. 

if (receiveReq.readyState == 4) {
   if (receiveReq.status == 200){
      document.getElementById('span_result').innerHTML = receiveReq.responseText;}
   else{
      document.getElementById('span_result').innerHTML = "error calling webscript";
      }
}

The javascript controller is being executed since I can see the logger statements that it generates.  When I execute the web script from a browser address bar the template generates correctly so this problem only occurs via Ajax call.

I purposely made the controller and template very simple as an initial test, but still no responseText.  The descriptor specifies guest authorization and I specify guest=true on the URL.  The controller is not trying to access any repository functions so authorization is not the cause of the problem.
1 REPLY 1

stevegreenbaum
Champ in-the-making
Champ in-the-making
The problem only occurs when I use Firefox (3.5.6).  Using IE8 I am receiving the response I expect.

Note that I am using the latest release of the v2 YUI Connection Manager.

The following error is generated in the Alfresco log:

13:04:22,234 ERROR [org.alfresco.web.scripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 00010017 Script url /getargsWebscript/getargs.json does not support the method OPTIONS
org.alfresco.web.scripts.WebScriptException: 00010017 Script url /getargsWebscript/getargs.json does not support the method OPTIONS
   at org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:113)

Based on some reading, Firefox 3.5 uses a new technique for cross domain authentication which requires a change to how the server responds.  I am wondering if this is the root of the problem. 

https://developer.mozilla.org/En/HTTP_access_control'>
https://developer.mozilla.org/En/HTTP_access_c...


For those that use Firebug, this may be of interest as well:

http://tiddlywiki.org/wiki/I_get_%27Permission_denied_to_call_method_XMLHttpRequest.open%27_when_usi...
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.