GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
can i pass variable with a callback to a json query?  XML
Forum Index -> General
Author Message
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?
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

[WWW]
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:   
Powered by JForum 2.1.5 © JForum Team