We had the same problem. The JSON replied is valid but still failed.
Then we found the problem to be the space before the first curly
bracket ( { ). So make sure the first character of your JSON string is
a curly bracket, without anything before it.


On Jan 7, 4:24 pm, Grummfy <[email protected]> wrote:
> like I said, json is valid
>
> but it contains some html tag, I will try to remove them.
>
> thanks for the tips
>
> On 6 jan, 18:22, Sean McArthur <[email protected]> wrote:
>
>
>
> > Even if you're saying 200 but returning nothing for the body, it fails.
> > Return something, like '1'.
>
> > On Thu, Jan 6, 2011 at 8:08 AM, Stewart Mckinney <[email protected]>wrote:
>
> > > Either that or you have javascript or HTML elements returned in your JSON 
> > > -
> > > JSON.decode will return a failure in both cases in secure mode.
>
> > > On Thu, Jan 6, 2011 at 8:38 AM, Arian Stolwijk <[email protected]> wrote:
>
> > >> Maybe your JSON isn't valid?
>
> > >> On Thu, Jan 6, 2011 at 2:28 PM, Grummfy <[email protected]> wrote:
>
> > >>> Ok, problem comes from secure option in JSON.decode with secure at
> > >>> true.
>
> > >>> But I don't understand why it's a problem ...
>
> > >>> On 6 jan, 12:55, Grummfy <[email protected]> wrote:
> > >>> > Hello,
> > >>> > I have a problem with aRequest.Jsoncall :
> > >>> > I call some Request one after one (called in complete event) :
> > >>> > The response is strange :
> > >>> > I have this event : failure, failure, failure, failure, failure, ...
> > >>> > But all response have a status 200 OK, all response are good and
> > >>> > complete.
>
> > >>> > Tested on Google Chrome 8.0.552.224 and Mozilla Firefox 3.6.13 with
> > >>> > firebug 1.6.1.
>
> > >>> > My call :
> > >>> > var request = newRequest.JSON(
> > >>> > {
> > >>> >         method: 'GET',
> > >>> >         onComplete: callbacks['complete'],
> > >>> >         onSuccess: callbacks['success'],
> > >>> >         onFailure: callbacks['failure'],
> > >>> >         onException: callbacks['exception'],
> > >>> >         url: url});
>
> > >>> > request.send();
>
> > >>> > callbacks is an array with functions, with console.log('name of
> > >>> > event'); and callbacks['complete'] rebuild a new request object

Reply via email to