[OpenLayers-Dev] Why check the fileType of ajax request for xml?

XinGang Li slinavlee at gmail.com
Wed Mar 12 01:11:08 EDT 2008


In the layers that load data from xml stream, we always check the fileType
like this:

requestSuccess:function(request) {
        if (this.features) {
            var doc = request.responseXML;

            if (!doc || request.fileType!="XML") {
                doc = OpenLayers.parseXMLString(request.responseText);
            }
......

I tested on IE6 and firefox2, the fileType is undefined, and this will force
re-parse the xml string.

-- 
Li XinGang
EMail: slinavlee at gmail.com
Blog:   avlee.cnblogs.com
Site:    www.mapboost.org.cn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20080312/53af6154/attachment.html


More information about the Dev mailing list