1. #1
    Sencha Premium Member
    Join Date
    Dec 2010
    Location
    San Diego, CA
    Posts
    49
    Vote Rating
    1
    kathir is on a distinguished road

      0  

    Default 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.


    Code:
     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'
                    }
                }
            });
    but what i see is the Uncaught SyntaxError: Unexpected token : , The console shows the json data as below

    Code:
    {"customers":[{"id":"InitialDefault","customerPk":61},{"id":"Userdefined","customerPk":21}]}
    Thanks for the help.

  2. #2
    Sencha User
    Join Date
    Jun 2011
    Location
    San Jose
    Posts
    7
    Vote Rating
    0
    agg.varun@gmail.com is on a distinguished road

      0  

    Default


    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.

  3. #3
    Touch Premium Member
    Join Date
    May 2011
    Location
    Norfolk & DC
    Posts
    100
    Vote Rating
    5
    epiphanydigital is on a distinguished road

      0  

    Default 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?

  4. #4
    Sencha User
    Join Date
    Jun 2011
    Location
    San Jose
    Posts
    7
    Vote Rating
    0
    agg.varun@gmail.com is on a distinguished road

      0  

    Default


    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.

  5. #5
    Sencha User
    Join Date
    May 2011
    Location
    Karachi
    Posts
    9
    Vote Rating
    0
    arfeen is on a distinguished road

      0  

    Lightbulb 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
    Code:
    Uncaught SyntaxError: Unexpected token <
    I was having the same error while submitting a simple form without file field but I had mistakenly put the property
    Code:
    fileUpload: true
    Which caused the above error. When I removed the property it worked fine.

    Thanks

    Arfeen

Similar Threads

  1. Uncaught SyntaxError: Unexpected token
    By jaquin in forum Sencha Touch 1.x: Discussion
    Replies: 6
    Last Post: 3 Feb 2011, 4:48 AM
  2. Replies: 10
    Last Post: 2 Jan 2011, 4:52 PM
  3. JSON+decode+syntaxerror
    By veereshsh in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 3 Feb 2009, 7:03 PM
  4. Adding a Token
    By boriscy in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 26 Mar 2008, 11:03 AM

Thread Participants: 3

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar