even declaring the array global, it contains nothing at all. any idea
please :)

On Mar 14, 4:53 pm, Telehealth Telehealth <[email protected]>
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 <[email protected]>
> wrote:
>
>
>
> > On Mar 13, 3:00 pm, Telehealth Telehealth <[email protected]>
> > 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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to