0
我在期待「hello world」,但我從AJAX響應中變得空白或未定義。如果我使用xdmp:log(),我可以看到我在測試函數中。爲什麼這個XQuery不能使用AJAX返回文本?
(: 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");