[Javascript] Object literal toString

Laurent Muchacho elmuchacho at gmail.com
Tue Mar 14 09:25:04 CST 2006


Many thanks Steve I did knew about JSON but was trying a work around. I end
up using json in the end.

Laurent

On 3/14/06, Steve Clay <sclay at ufl.edu> wrote:
>
> Tuesday, March 14, 2006, 6:02:32 AM, Laurent Muchacho wrote:
> > http://www.be-lovely.com/code_pool/examples/object_literal_toSource.htm
>
> toSource() was added in JS1.3 and apparently never adopted in IE/Opera.
>
> > anyone know a cross browser way to do this.
>
> The JSON.stringify() method might be a good enough approximation of
> toSource(). You'll get an eval()-able string of properties, but I don't
> know if methods are preserved. Give it a shot.
> Info: http://www.json.org/js.html
> Script: http://www.json.org/json.js
>
> Steve
> --
> http://mrclay.org/
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20060314/441490b2/attachment.htm>


More information about the Javascript mailing list