Dojo JSON call back always returns an error
- by Sunny
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?