> > I suppose this touches on off topic, but ... is it possible 
> > to remove an entry completely from a JSON hash?
> >
> > say I have
> > {
> > firstString: 'first',
> > secondString: 'second'
> > }
> >
> > and evaluate this into a json object, and I want to remove 
> > firstString, could I do something like 
> > json.remove(json.firstString); 

> I think
> 
> json.firstString = null
> 
> or
> 
> delete json.firstString
> 
> work (although IIRC delete is not supported by IE 5.5 or earlier).

"json.firstString = null" does not delete the property. It merely sets its
value to null.

delete json.firstString actually deletes the property. It is supported by
every browser that jQuery supports.

For IE, the delete operator goes back to JScript 3.0, which was implemented
in IE 4.0.

Here is a handy chart that shows IE version support for JavaScript features:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/ht
ml/440f4924-f7a9-48e0-873e-bd599a93b437.asp

-Mike


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to