我使用CQ.HTTP.post
来调用某些validation servlet
并从true
获取验证结果false
或servlet
:
function getValidation(){
var validationResult =false;
CQ.HTTP.post(
"/bin/myServlet",
function(options, success, response) {
validationResult = response.responseText;
},
{
"foo": baar
},
this,
true
);
return Boolean(validationResult);};
firebug显示servlet Response
为true
,但函数getValidation()
仍然返回false
,这意味着变量validationResult
不会变化
如何将servletResponse设置为变量validationResult?