[OpenLayers-Users] Problem with OpenLayers.Ajax.Request

Alan Boudreault aboudreault at mapgears.com
Fri Jul 11 08:52:14 EDT 2008


Hi Walter,

I found this example in WFS.js :

     new OpenLayers.Ajax.Request(url,

                         {   method: 'post',

                             postBody: data,

                             onComplete: success,

                             onFailure: failure

                          }

                         );

Your method seems to be ok. I don't really know postBody must be 
structured.... but i suggest you to use Firebug (for FireFox) and put a 
breakpoint in the "request" method of OpenLayers.Ajax.Request class 
(OpenLayers-2.6/lib/OpenLayers/Ajax,js) and see if your params are well 
sent.

Regards
Alan

Walter Lorenzetti wrote:
> Hi all,
>
> I've a problem with OpenLayers.Ajax.Request
>
> if I try to use it like...
>
> var params = 'var1=val1' + '&var2=val2' + '&varjson='+valjson ;
> new OpenLayers.Ajax.Request(url, {method:'post', postBody:params, 
> requestHeaders: ['Accept', 'text/html']});
>
> on url php file doesn't find nothing in $_POST variable..
>
> Any people have an idea about this?
> I'm using Openlayers 2.6
>
> Thanks in advance
>
> Walter
>
>   


-- 
Alan Boudreault
Mapgears
http://www.mapgears.com




More information about the Users mailing list