rona wrote:
> HI i am still have a problem with retrieving data from geonames.org
> i used XML ASP proxy named "proxy.asp"
Rona, you are not listening. Stop beating your head against the
wall. JSON & XML are entirely different animals. You are trying to
retrieve JSON results with XML access methods. JSON is JAVASCRIPT.
XML is structured text. JSON uses dynamic SCRIPT tags WITHOUT a
proxy. XML uses either XMLHttpRequest or its sugar coated substitute
GDownloadUrl WITH a proxy. www.geonames.org supports both except in a
very limited number of cases.
If you try to fetch JSON formatted results with XML methods, it will
fail. If you try to fetch XML formatted results with JSON methods, it
will fail. JSON is easy. XML is difficult. If you show some
willingness to try to understand the difference, people will help
you. If you just stubbornly post the same clueless plea, noone will
help you. You may be in the wrong profession.
> rona wrote:
> > HI i am still have a problem with retrieving data from geonames.org
> > i used XML ASP proxy named "proxy.asp"
> Rona, you are not listening. Stop beating your head against the
> wall. JSON & XML are entirely different animals. You are trying to
> retrieve JSON results with XML access methods. JSON is JAVASCRIPT.
> XML is structured text. JSON uses dynamic SCRIPT tags WITHOUT a
> proxy. XML uses either XMLHttpRequest or its sugar coated substitute
> GDownloadUrl WITH a proxy. www.geonames.orgsupports both except in a
> very limited number of cases.
> If you try to fetch JSON formatted results with XML methods, it will
> fail. If you try to fetch XML formatted results with JSON methods, it
> will fail. JSON is easy. XML is difficult. If you show some
> willingness to try to understand the difference, people will help
> you. If you just stubbornly post the same clueless plea, noone will
> help you. You may be in the wrong profession.
function getLocation(jData) {
if (jData == null) {alert("sdasd");}
var html = '';
var geonames = jData.geonames;
for (i=0;i< geonames.length;i++) {
var name = geonames[i];
alert("dfsdf");
html = html + '<a href="javascript:center(' + name.lat +',' +
name.lng + ');">' + name.name + '</a><br>';
}
document.getElementById('side_bar').innerHTML = html;
}
but didnt got any results..
is this the right way to work with json
RegARDS
On Sep 7, 3:36 pm, rona <aymensoly...@gmail.com> wrote:
> Ok i thanks for ur advice ad i am starting to work with json ..the
> problem that i lost with different options ..that is the problem
> Thanks for ur advice
> On Sep 7, 3:20 pm, bratliff <bratl...@umich.edu> wrote:
> > rona wrote:
> > > HI i am still have a problem with retrieving data from geonames.org
> > > i used XML ASP proxy named "proxy.asp"
> > Rona, you are not listening. Stop beating your head against the
> > wall. JSON & XML are entirely different animals. You are trying to
> > retrieve JSON results with XML access methods. JSON is JAVASCRIPT.
> > XML is structured text. JSON uses dynamic SCRIPT tags WITHOUT a
> > proxy. XML uses either XMLHttpRequest or its sugar coated substitute
> > GDownloadUrl WITH a proxy. www.geonames.orgsupportsboth except in a
> > very limited number of cases.
> > If you try to fetch JSON formatted results with XML methods, it will
> > fail. If you try to fetch XML formatted results with JSON methods, it
> > will fail. JSON is easy. XML is difficult. If you show some
> > willingness to try to understand the difference, people will help
> > you. If you just stubbornly post the same clueless plea, noone will
> > help you. You may be in the wrong profession.- Hide quoted text -
> > Ok i thanks for ur advice ad i am starting to work with json ..the
> > problem that i lost with different options ..that is the problem
> > Thanks for ur advice
> > On Sep 7, 3:20 pm, bratliff <bratl...@umich.edu> wrote:
> > > rona wrote:
> > > > HI i am still have a problem with retrieving data from geonames.org
> > > > i used XML ASP proxy named "proxy.asp"
> > > Rona, you are not listening. Stop beating your head against the
> > > wall. JSON & XML are entirely different animals. You are trying to
> > > retrieve JSON results with XML access methods. JSON is JAVASCRIPT.
> > > XML is structured text. JSON uses dynamic SCRIPT tags WITHOUT a
> > > proxy. XML uses either XMLHttpRequest or its sugar coated substitute
> > > GDownloadUrl WITH a proxy. www.geonames.orgsupportsbothexcept in a
> > > very limited number of cases.
> > > If you try to fetch JSON formatted results with XML methods, it will
> > > fail. If you try to fetch XML formatted results with JSON methods, it
> > > will fail. JSON is easy. XML is difficult. If you show some
> > > willingness to try to understand the difference, people will help
> > > you. If you just stubbornly post the same clueless plea, noone will
> > > help you. You may be in the wrong profession.- Hide quoted text -
Well, that's a nice string variable; but you don't do anything with
it.
You need to do something else to make your script go off and fetch the
data from that URL, a substitute for GDownloadUrl if you like.