how to use web api with javascript/php?

Posted by fayer on Stack Overflow See other posts from Stack Overflow or by fayer
Published on 2010-03-20T07:40:34Z Indexed on 2010/03/20 7:51 UTC
Read the original article Hit count: 451

Filed under:
|
|
|

geonames.org got a web api you can use to get all the hierarchy for a city.

you just enter the id and you will get the data back in xml.

http://ws.geonames.org/hierarchy?geonameId=2657896 

i wonder how you fetch the url with php and javascript, and which one should i use.

cause the id's are in the mysql database. i will get them with php.

should i use file_get_contents, curl or fopen?

and what function in javascript? jquery $.post? heard that it can only access localhost.

would be great with some guidance here and even better with some code examples.

thanks!

© Stack Overflow or respective owner

Related posts about php

Related posts about Xml