[OpenLayers-Users] OpenLayers.Request.POST/GET errors

Brent Pedersen bpederse at gmail.com
Wed Oct 8 14:54:59 EDT 2008


hi, i havent followd this thread, but have you looked at this?
http://trac.openlayers.org/wiki/FrequentlyAskedQuestions#ProxyHost

you can't make an AJAX request to a remote server, it looks like
that's what you're doing.
if that's the case, use a proxy. if it's not, then use a relative url.

-brent

On Wed, Oct 8, 2008 at 11:49 AM, Ian <iansgis at gmail.com> wrote:
>
>> hrm, all I can think of is maybe callback is required...
>> add
>> callback: function(){alert('Maybe Im required')},
>> somewhere in there
>>
>> did "getStringItem1" and "item2" make it inside the $_GET array?
>> In firebug, when you look at the response you are getting back is it
>> completely empty?
>> If so, try putting an echo an the beginning of your php file to see if it
>> is even getting there.
>
> Adding the callback did take care of the javascript error, but Firebug is
> still showing an empty POST (though "getStringItem1" and "item2" are in the
> Params section). The values do not make it into the $_POST array however
> they are in the $_GET array.
>
> I also tried doing a GET a couple of different ways, both with different
> results:
>
> new OpenLayers.Request.issue({method:'GET', url:.....});
> Nothing happens, the GET never even shows up in Firebug.
>
> new OpenLayers.Request.issue({url:...});
> Since GET is the default I tried this method as well and got the javascript
> error:
>
> Error: uncaught exception: [Exception... "Component returned failure code:
> 0x80070057
> (NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]"  nsresult: "0x80070057
> (NS_ERROR_ILLEGAL_VALUE)"  location: "JS frame ::
> http://openlayers.org/api/OpenLayers.js ::
> anonymous :: line 511"  data: no]
>
> Hopefully using a POST and accessing the $_GET array will work for my code.
> Being a relative newbie to PHP and AJAX, I don't know if this is intended
> behavior for OpenLayers.Request but I wanted to document my results. Thank
> you for the help!
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>



More information about the Users mailing list