为什么这个XQuery不使用AJAX返回文本?

为什么这个XQuery不使用AJAX返回文本?,ajax,xquery,marklogic,Ajax,Xquery,Marklogic,我期待着HelloWorld,但是AJAX响应中出现了空白或未定义的内容。如果我使用xdmp:log,我可以看到我在测试函数中 (: test.xqy there is a get request field that calls the test function based on the test parameter from url :) declare function local:test(){ let $hello := "hello world" return $

我期待着HelloWorld,但是AJAX响应中出现了空白或未定义的内容。如果我使用xdmp:log,我可以看到我在测试函数中

(: test.xqy there is a get request field that calls the test function 
   based on the test parameter from url :)

declare function local:test(){
  let $hello := "hello world"
  return $hello
}

// ajax from js file
$j.get("/search/survey.html?test", null, function(res){
  console.log("res:");
  console.log(res); // blank
  console.log(res.responseText); // undefined
}, "text");

我有另一个函数,它使用get请求字段来调用测试函数。问题是我没有在该函数中返回任何内容