AnsweredAssumed Answered

[Solved]Ajax – empty responseText on GET

Question asked by stevegreenbaum on Dec 29, 2009
Latest reply on Dec 29, 2009 by stevegreenbaum
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.

Outcomes