GeoNames Home
|
Postal Codes
|
Download / Webservice
|
About
GeoNames Forum
Search
Recent Topics
Back to home page
Register
/
Login
can i pass variable with a callback to a json query?
Forum Index
->
General
Author
Message
29/01/2010 19:15:53
Subject:
can i pass variable with a callback to a json query?
tlove
Joined: 29/01/2010 19:09:40
Messages: 2
Offline
this is probably a dumb question since im new to javascript
i would really like to pass a variable with my call back to a json service. so like &callback=myfunction(mydiv)
i cant figure out how to reference the response and a passed variable.
function myfunction(response,mydiv) { //this of course doesnt work
}
is this possible, anybody got an example around?
30/01/2010 08:06:07
Subject:
Re:can i pass variable with a callback to a json query?
marc
Joined: 08/12/2005 07:39:47
Messages: 4501
Offline
there is an example here:
http://www.geonames.org/export/ajax-postalcode-autocomplete.html
30/01/2010 18:32:44
Subject:
Re:can i pass variable with a callback to a json query?
tlove
Joined: 29/01/2010 19:09:40
Messages: 2
Offline
thanks but i dont think you understand what i am asking for. i have seen the page you sent me and i have already implemented something like that, but what i would like to do is pass a variable through the call back like this..
request = 'http://www.geonames.org/postalCodeLookupJSON?postalcode=' + postalcode + '&country=' + country + '&callback=getLocation(result,divtoloadresultin)';
the line above is from the example page you sent me but with
the app i am working on is here
http://map.region3dfg.org/dev/r3starter3_7.html
use the info point tool at the bottom of the screen
(may be broken when yu go there, its under development.)
Forum Index
->
General
Go to:
Select a forum
Forum in English
-------------
General
Administrative Divisions
FAQ - frequently asked questions
Postal Codes
Discussion of GeoNames Toponyms
Forum in other language
-------------
Forum in Deutsch
Powered by
JForum 2.1.5
©
JForum Team
info@geonames.org
GeoNames Home
Postal Codes
Download / Webservice
Forum
About