I
I
Ilya2011-09-28 15:17:34
JSON
Ilya, 2011-09-28 15:17:34

Help get data from .json file

Hello!

I'm trying to parse data from another site using the $.getJSON(url,[data],[callback]) function.

Since the link goes to another domain, I write it like this:
url = "../../..php?jsoncallback=?"

But this approach only works if the path is set to a file with the php extension.
I want to access the file in json format.
How to correctly model a link to it?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anton, 2011-09-28
@sHinE

Are you generating JSON or not? Because in order to work from another domain, you need not just JSON, but JSONP - en.wikipedia.org/wiki/JSONP

I
Ilya, 2011-09-28
@geeek

Generated as response.

I
Ilya, 2011-09-28
@geeek

The problem was solved by copying the file to my server. Thanks a lot for the replies.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question