On Thursday, November 26, 2009, Mak Kolybabi <[email protected]> wrote:
> I've wasted long enough on this, it's time to ask for help...
>
> I'm making a simple Ajax request with OpenLayers.loadURL, which works 
> perfectly.
> If I process the return data with:
>
>     var info = eval("(" + response.responseText + ")");
>
> a proper object is created in both IE and Firefox. But if I try to use:
>
>     var parser = new OpenLayers.Format.JSON();
>     var info = parser.read(response.responseText);
>
> nothing happens. In fact, if I try:
>
>     var parser = new OpenLayers.Format.JSON();
>     var info = parser.read("{'a': 1}");


This isn't valid JSON. Use <http://www.JSONLint.com/>. Try {"a": 1}.

Cheers,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : [email protected]
http://www.camptocamp.com
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to