Despite passing validation on jsonlint, both Firefox and Chrome are rejecting this JSON:
{
"messages": [
{
"subject": "One"
},
{
"subject": "Two"
},
{
"subject": "Three"
}
],
"totalResults": 10
}
The specific error message is "invalid label" related to "messages."
This is how the data is being loaded:
var store = Ext.create('Ext.data.Store', {
model: 'MyModel',
autoLoad: true,
pageSize: 3,
proxy: {
type: 'jsonp',
url: 'http://localhost:8080/document-viewer-1.0/testdata.json',
reader: {
root: 'messages',
totalProperty: 'totalResults'
}
}
});
Solution:
This issue was due to my own oversight. I neglected to encapsulate the JSON file structure with the JSONP callback name.