If you specify json output in the $.ajax call and the resulting output isn't
well-formed json for any reason, it causes a javascript error on the eval in
$.ajaxData. Has anyone else encountered this? My quick fix was to wrap the
eval in a try/catch and return null if there was an error, does that
On 11/16/06, Dave Methvin [EMAIL PROTECTED] wrote:
If you specify json output in the $.ajax call and the resulting output isn't
well-formed json for any reason, it causes a javascript error on the eval in
$.ajaxData. Has anyone else encountered this? My quick fix was to wrap the
eval in a
Dave Methvin schrieb:
If you specify json output in the $.ajax call and the resulting output isn't
well-formed json for any reason, it causes a javascript error on the eval in
$.ajaxData. Has anyone else encountered this? My quick fix was to wrap the
eval in a try/catch and return null if
I may be showing my ignorance here, but why (or maybe more appropriately
how) would invalid json code get returned by your ajax call? Shouldn't
you just make sure that the data coming back is valid json? Maybe I've
not run into this because I'm using Jehiah Czebotar's CFJson (obviously,
my
Christopher Jordan schrieb:
I may be showing my ignorance here, but why (or maybe more appropriately
how) would invalid json code get returned by your ajax call? Shouldn't
you just make sure that the data coming back is valid json? Maybe I've
not run into this because I'm using Jehiah
I may be showing my ignorance here, but why (or maybe
more appropriately how) would invalid json code get
returned by your ajax call?
Ignorance, no. Lack of WTF imagination, yes. :-) On the server I was testing
against, status codes like 404 and 500 are mapped into 200 as a workaround
for
I assumed the lack of try catch code is to make jquery lean for the
majority... If you are getting garbage from your server add your
own try catch around the jquery call.
--
Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ
___
jQuery mailing list
discuss@jquery.com
That said, I think it should be as fail-safe as possible.
But which is worse - throwing an exception inside of jQuery due to
malformed JSON data - or silently dying?
I mean, as it stands right now, jQuery assumes that all data coming
into it (selectors, arguments, etc.) are well-formed. Beyond