Re: Problem about JSON and Geocoder
On Mar 14, 10:14 am, Telehealth Telehealth <telehealth...@gmail.com>
wrote:
> any idea
> please :)
Here's an idea:
http://groups.google.com/group/Google-Maps-API/web/why-including-a-link-is-critical
--
Marcelo - http://maps.forum.nu
--
>
> On Mar 14, 4:53 pm, Telehealth Telehealth <telehealth...@gmail.com>
> wrote:
>
>
>
> > In decoding the data got from a query in a php file using JSON, since
> > I don't have any knowledge about a callback function I tried placing
> > all the data in an array which i declared inside the function.
>
> > the decoding is successful as well as placing them in the array, I
> > simply tested it by making an alert() of the data in the array. after
> > the line of decoding which is this..
>
> > function geocode()
> > {
> > temp = array(); //sample array
> > queryString = the data that i need to search;
> > new Request( {method: 'post',
> > url: DOMAIN_URL + 'sample.php?v=' + new
> > Date().getTime(),
> > onSuccess: function(response){
> > /*
> > decoding of line
> > and placing the data in the array
> > alert(temp[i]) // successful
> > */
>
> > }).send(queryString);
>
> > alert(temp.length);
> > // the alert says the size is 0, no content? should I declare the
> > array global?
>
> > }
>
> > On Mar 13, 11:12 pm, Andrew Leach <andrew.leac...@googlemail.com>
> > wrote:
>
> > > On Mar 13, 3:00 pm, Telehealth Telehealth <telehealth...@gmail.com>
> > > wrote:
>
> > > > Thank you very much for giving that link to me, it took me an hour of
> > > > searching for the answer to my problem after posting this question
> > > > yesterday, and I found out that geocoder really is asynchronous. After
> > > > that I tried searching of a possible way or similar to alert(); in
> > > > javascript in order to pause all processing of codes, can you give me
> > > > any idea on how can i do that is similar to alert();? using a
> > > > synchronous like alert but doesnt need to be clicked by someone, let
> > > > say similar to setTimeout();
>
> > > With asynchronous functions you need to put everything you want to do
> > > with the data into the callback function. There isn't another way of
> > > doing it, as the data is only reliably available to the callback
> > > procedure.
>
> > > Google mangled the link I gave (in the web view of the Group):http://www.easypagez.com/hosting.html
--
You received this message because you are subscribed to the Google Groups "Google Maps API" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home