As commented in your commit, I think the support approach is cleaner and
more future-proof (that is when Chrome implements JSON parsing controls
properly).

2010/1/12 John Resig <jere...@gmail.com>

> As a note: I added identical errors earlier today but skirted around
> the need to have any sort of support property:
>
> http://github.com/jquery/jquery/commit/44e6beb10304789044de2c5a58f5bb82e8321636
>
> --John
>
>
>
> On Mon, Jan 11, 2010 at 7:51 PM, AlexSexton <alexsex...@gmail.com> wrote:
> > I went ahead and wrote a support flag and an implementation of a check
> > for nonstandard window.JSON.parse methods (including chrome) inside of
> > the ajax httpData method.
> >
> > My change is here:
> http://github.com/SlexAxton/jquery/commit/57313eb69a7c87f862440b062932e91c0e162c6c
> >
> > I think consistently throwing errors on invalid json could prove to be
> > pretty important until browsers even out support a little bit. Anyone
> > see any issues with this implementation?
> >
> > Alex
> >
> > On Jan 10, 5:48 pm, DBJDBJ <dbj...@gmail.com> wrote:
> >> Actually the simplest "way out" is to have new jQuery.support member :
> >>
> >> jQuery.support.nonstandard_json_string =
> >>                 function () {
> >>                try { JSON.parse("{ a : 1 }"); return true ; } catch(x)
> >> { return false; }
> >>             }();
> >>
> >> As far as I know "only" in CHROME :
> >> jQuery.support.nonstandard_json_string === true ;
> >>
> >> Having this implement JSON parsing logic in 1.4 ...
> >>
> >> --DBJ
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "jQuery Development" group.
> > To post to this group, send email to jquery-...@googlegroups.com.
> > To unsubscribe from this group, send email to
> jquery-dev+unsubscr...@googlegroups.com<jquery-dev%2bunsubscr...@googlegroups.com>
> .
> > For more options, visit this group at
> http://groups.google.com/group/jquery-dev?hl=en.
> >
> >
> >
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "jQuery Development" group.
> To post to this group, send email to jquery-...@googlegroups.com.
> To unsubscribe from this group, send email to
> jquery-dev+unsubscr...@googlegroups.com<jquery-dev%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/jquery-dev?hl=en.
>
>
>
>
--
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-...@googlegroups.com.
To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en.

Reply via email to