Problems with JSON and trailing comma with IE6

At work a GWT project was modified to use JSON instead of GWT RPC. It worked fine on FF3 and Safari but failed horribly on IE6. The error message was not too helpful: (TypeError): 'null' is null or not an object number: -2146823281 description: 'null' is null or not an object

To investigate this I installed Fiddler to check responses sent by the server. It turned out that our JSON collections had an extra comma after the last item. This trailing comma caused IE to expect yet another item.

Such a small and easy to fix problem but rather tricky to find - but that is life of a programmer.

Comments

No comments yet

Add Comments