[OpenLayers-Users] Passing parameters to ajax request callback method

Eric Lemoine eric.c2c at gmail.com
Mon Mar 16 14:01:26 EDT 2009


Hi

You would use a JavaScript closure for that. The
OpenLayers.Function.bind can create that closure for you.

Cheers,

Eric

2009/3/16, Zer <zer_matt at hotmail.com>:
>
> Hi list,
>
> Is there a way to pass a parameter to the callback method that is called in
> an ajax request?
>
> Something like this:
>
> myRequest = OpenLayers.Request.GET(
> 		{
> 			url :myUrl,
> 			callback :myCallback(myParameter)
> 		});
>
> and then:
>
> function myCallback(response, myParameter) {
> ....
>
>
> Thanks,
>
>
> -Z
>
> --
> View this message in context:
> http://n2.nabble.com/Passing-parameters-to-ajax-request-callback-method-tp2487503p2487503.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>

-- 
Envoyé avec mon mobile



More information about the Users mailing list