[OpenLayers-Dev] Format.JSON in IE sometimes failing

bartvde at osgis.nl bartvde at osgis.nl
Wed Oct 29 09:20:17 EDT 2008


Hi list,

I've got an object (with a multipolygon node specifically) which fails
(Object doesn't support this action) to serialize properly to JSON in IE6.
In Firefox it works fine. This is both with OpenLayers.Format.JSON as well
as the ExtJS JSON encoder btw.

In order to fix is, I've put a try catch around the statement which
determines the valueJSON:

+                    try {
                     valueJSON =
OpenLayers.Format.JSON.prototype.write.apply(this,
                                                     [object[key],
this.pretty]);
+                    } catch (err) { valueJSON = null; }

Is this something for trunk, or do people see potential issues with such a
change?

Best regards,
Bart




More information about the Dev mailing list