cometta
cometta

Reputation: 35679

Jquery ajax parse error

My server side will reply with json look like {} && {"id":2....} . i use jquery.ajax to GET the response. but i keep getting "error parseerror" , how to parse data like this using jquery.ajax?

Upvotes: 2

Views: 555

Answers (2)

Scott Harwell
Scott Harwell

Reputation: 7465

You should return only one json object at a time. If you need to return more than one data model, then build an array or set of objects in the json object.

{itemOne:{}, itemTwo:{}, arrayOfSomething:[]}

Upvotes: 1

Royi Namir
Royi Namir

Reputation: 148514

this is not valid jSon.........

Upvotes: 3

Related Questions