[OpenLayers-Dev] OpenLayers Ajax in trunk

Tim Schaub tschaub at openplans.org
Sun Feb 24 13:34:04 EST 2008


Hey-

Eric Lemoine wrote:
> On Sat, Feb 23, 2008 at 9:49 PM, Sean Gillies <sgillies at frii.com> wrote:
>> Eric Lemoine wrote:
>>  > The OpenLayers Ajax code doesn't allow for other HTTP methods than GET and POST!
>>  >
> 
>> Is anybody currently relying on this feature of Ajax.js?
> 
> "Feature" ?? ;-)
> 
> FYI Tim Schaub has started working on new XHR support in OpenLayers.

Yeah, I recognize I sound a bit like a broken record, but I want to get 
out from under this hacked ex-Prototype.js mess.

I mentioned the POST/GET problem (limit to those verbs) to Chris a bit 
ago as another reason to ditch the whole thing.  I don't see value in 
continuing to fix this code (though that one is an easy fix).

So, I've put together a proposal for what I think is a better solution:
http://trac.openlayers.org/wiki/Proposal/Request

(Note that all code on that wiki page and in the sandbox mentioned there 
was written without testing.  I'm confident that it will all work in the 
end but will not be surprised if someone points out typos.)

Basically, I like the XMLHttpRequest interface.  I just think we need a 
few simple things to capture common patterns in using XMLHttpRequest. 
For me, this is captured in the "issue" function in my Request.js [1].

I know others like the loadURL signature.  I don't see the need for 
onComplete *and* onFailure (since there are many ways "failure" can 
occur - including failure to parse XML which means your onComplete 
function still needs "failure" checking code), but they are easy to 
support as long as we keep loadURL around.

Interested to hear any feedback.

Tim

[1] 
http://trac.openlayers.org/browser/sandbox/tschaub/request/lib/OpenLayers/Request.js

> 
> <http://dev.openlayers.org/sandbox/tschaub/request/>
> <http://dev.openlayers.org/sandbox/tschaub/request/lib/OpenLayers/Request.js>
> <http://dev.openlayers.org/sandbox/tschaub/request/lib/OpenLayers/Request/XMLHttpRequest.js>
> 
> That new code will support PUT and DELETE. Good Thing!
> 
> Cheers,
> --
> Eric
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
> 
> !DSPAM:4033,47c12d38212941439371379!
> 




More information about the Dev mailing list