PDA

View Full Version : problem with json url



manish khamar
19 Aug 2011, 10:12 PM
I validate my json webservice which is made in php and it show valid json.

Now problem is that when i parse my json string using Ajax.request then it show response properly.

But i want parse json in store using proxy means:

var c = new Ext.data.Store({
model: 'User',

autoLoad: true,
proxy: {
type: 'ajax',
//url:'trial.json',
headers: { 'Content-Type': 'application/json;charset=utf-8' },
url:'http://manish.kwetoo.com/mobile/mlsSearch.php?city=reno&state=nv&page=1&radius=1&datatype=json',


reader: {
type: 'json'
}
}
});

---end of code---------

But it do not parse properly and if i parse using json static code means i write in comment above that url :trial.json then it works properly.

So please help me to solve it.
I waste my lots of time behind it but i don't get proper solution .
So pls help me as soon as possible.:(

jay@moduscreate.com
23 Aug 2011, 11:57 AM
What does your model look like? Are you getting exceptions?

skirtle
23 Aug 2011, 9:03 PM
I'm suspicious of your URL. It will only work if your app is also hosted from http://manish.kwetoo.com/ due to the same origin policy. If you need to access remote data you'll need to use JSON-P.

http://en.wikipedia.org/wiki/Same_origin_policy