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

Eric Lemoine eric.c2c at gmail.com
Fri Oct 31 02:23:11 EDT 2008


Hi Bart

Do you know the reason of the failure on IE6? IE6 bug? Your patch
doesn't solve your problem but provides better error handling, right?
Maybe an error message should be output to the console in case of
serialization failure. Eric

2008/10/29, bartvde at osgis.nl <bartvde at osgis.nl>:
> 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
>
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>



More information about the Dev mailing list