/    Sign up×
Community /Pin to ProfileBookmark

download and read JSON file

Hi All,
please can you help me with following? I need to download and read one *.json file in my javascript. Do you know about some library or the best how to do that? The best would be be if the solution would work in all web-browsers.

Thanks,
miro

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@KorSep 14.2010 — You may use AJAX and a JSON parser code. See:

http://www.w3schools.com/Ajax/Default.Asp

http://json.org/
Copy linkTweet thisAlerts:
@rnd_meSep 15.2010 — if you put a word in front of the JSON, and wrap it in parens, you can load the file simply by point a script tag's .src property at the url of the json file.

this pattern is called jsonp, and it works in every browser with minimal code, no ajax required.
×

Success!

Help @miro spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...