[OpenLayers-Dev] Re : OpenLayers.loadURL( ) : params - Params on get (doesnt seem to work)

Jc Albert jcalbert802 at yahoo.fr
Fri Mar 7 03:40:18 EST 2008


Hi,

A suggestion :
In Util.js at line ~825
In the function "OpenLayers.Util.getParameters (url)"


You have : 
...
//parse out parameters portion of url string
var paramsString = "";
...

I propose :
...
//parse out parameters portion of url string
var paramsString = url;
...

I tested it, and that solved the problem here...

Regards 

Jean-Christophe



----- Message d'origine ----
De : Eric Lemoine <eric.c2c at gmail.com>
À : Jc Albert <jcalbert802 at yahoo.fr>
Cc : dev at openlayers.org
Envoyé le : Jeudi, 6 Mars 2008, 21h41mn 51s
Objet : Re: [OpenLayers-Dev] OpenLayers.loadURL( ) : params - Params on get (doesnt seem to work)

On Thu, Mar 6, 2008 at 9:36 PM, Eric Lemoine <eric.c2c at gmail.com> wrote:
> 2008/3/6 Jc Albert <jcalbert802 at yahoo.fr>:
>
> >
>  > Hi,
>  >
>  > When calling this function the 'params' parameter doesn't work.
>  > I think I've found why  :
>  >
>  > When you call OpenLayers.loadURL(url, param,... ) and you give string like
>  > param = "toto=blabla&titi=haha";
>  >
>  > The following function (Ajax.js, line 257) :
>  > this.options.parameters =
>  > OpenLayers.Util.getParameters(this.options.parameters);
>  > return null.
>  >
>  > OpenLayers.Util.getParameters() seems to need a full url like
>  > "page.php?toto=blabla&titi=haha" to work.
>  > if you only give the params, it return null. So parameters are lost.
>
>  Hi Jc
>
>  It looks like you've found a bug in the Ajax code. Note however that
>  providing a object instead of a string should work:
>  OpenLayers.loadURL(url, {'fookey':'fooval','barkey':'barval'});

I've opened a ticket for this stuff: <http://trac.openlayers.org/ticket/1419>

Thanks for reporting this Jc.

--
Eric






      _____________________________________________________________________________ 
Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20080307/e90c3ddf/attachment.html


More information about the Dev mailing list