-
17 Jan 2011 6:15 PM #1
Uncaught SyntaxError: Unexpected token :
Uncaught SyntaxError: Unexpected token :
Hi,
I am new to Sencha touch and trying to get a List from a json data.
but what i see is the Uncaught SyntaxError: Unexpected token : , The console shows the json data as belowCode:Ext.regModel('customer', { fields: [{ name: 'id', type: 'string' }, { name: 'customerPk', type: 'string' }] }); var store = new Ext.data.Store({ autoLoad: true, model: 'customer', proxy: { url: 'http://localhost:8080/restservices/findAllCustomers.json', type: 'scripttag', reader: { root: 'customers' } } });
Thanks for the help.Code:{"customers":[{"id":"InitialDefault","customerPk":61},{"id":"Userdefined","customerPk":21}]}
-
2 Jun 2011 8:58 AM #2
Hi
Did you get that fixed. I am very new to Sencha, i am trying to build the test application with sencha touch and facing the same issue.
I am using scripttag to query this url http://dev.sencha.com/deploy/touch/e...ourceFiles.php (from examples) and creating a nested list.
Here is what i am doing in the store
proxy:{
type: "scripttag",
url: "http://dev.sencha.com/deploy/touch/examples/nestedlist/getSourceFiles.php",
id:"someid",
reader:{
type: "tree",
root: "children"
}
}
But i see the same error you are mentioning.
-
27 Jun 2011 8:28 AM #3
Bump...
Bump...
Same issue here. Works fine with type "ajax" if I load the json file from localhost. I get an "unexpected token :" if I load with "scripttag" from another server though. Anyone have a solution?
-
27 Jun 2011 9:38 AM #4
Hi
It seems like scripttag doesnt help. What you have to do is add a callback to your request and set the server so that it it adds the callback with the results. If you still cant do it then i would say just proxy the calls to your own webserver that actually queries the url(other domain) and returns the results.
-
4 Aug 2011 4:03 AM #5
Uncaught SyntaxError: Unexpected token <
Uncaught SyntaxError: Unexpected token <
i would like to add my experience here for the problem when you are getting the error
I was having the same error while submitting a simple form without file field but I had mistakenly put the propertyCode:Uncaught SyntaxError: Unexpected token <
Which caused the above error. When I removed the property it worked fine.Code:fileUpload: true
Thanks
Arfeen
Similar Threads
-
Uncaught SyntaxError: Unexpected token
By jaquin in forum Sencha Touch 1.x: DiscussionReplies: 6Last Post: 3 Feb 2011, 4:48 AM -
extjs grid, json request getting "Uncaught SyntaxError: Unexpected token :" error
By mschlanser in forum Ext 3.x: Help & DiscussionReplies: 10Last Post: 2 Jan 2011, 4:52 PM -
JSON+decode+syntaxerror
By veereshsh in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 3 Feb 2009, 7:03 PM -
Adding a Token
By boriscy in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 26 Mar 2008, 11:03 AM


Reply With Quote