【发布时间】:2013-12-06 13:26:41
【问题描述】:
我使用REST 和Dojo 创建了一个登录名。我正在使用dojo xhrpost 提交我的登录表单数据。提交是通过 onClick 函数执行的。响应从 rest 方法返回。如何将响应对象存储在诸如dojo/Memory 的dojo/store 中?这样我就可以在任何 html 页面中检索它并删除注销的对象。
dojo.xhrPost({
url: "http://localhost:8080/userservices/rest/rest/login",
form: dojo.byId("formNode"),
load: function(user,status) {
if(status.xhr.status == 200) {
alert(user); //---> which displays username from the response method in rest method
// What code for could be here for storing that user as an object to dojo store or memory to access several pages and delete the object?
window.location.href ="jobseekerdashboard.html";
}
}
});
【问题讨论】:
标签: javascript dojo