Dojo JSON call back always returns an error
Posted
by Sunny
on Stack Overflow
See other posts from Stack Overflow
or by Sunny
Published on 2010-05-11T21:26:30Z
Indexed on
2010/05/12
6:24 UTC
Read the original article
Hit count: 237
Hi Guys,
I am using Dojo and making a AJAX call to a JAVA Class and trying to get the output of the program to a Alert box to the client.
var showResult = function(result){
console.log("Showing Result()");
var store = new dojo.data.ItemFileReadStore({ data: result});
console.dir(store);
store.fetch( { onItem: function(data) { alert("Hie"); },
onError: function(error,request){ alert("ERROR");}
});
};
This is my code, showResult basically is call back function from xhr request. I can see console.dir(store) printed onto Firebug but the fetch function always returns the onError block.
My store array is of the form {info="Test Message"} and I need to retrieve "Test Message" and display it in a Alert box. Any help?
© Stack Overflow or respective owner