JSON parse error, unexpected character

503 مرّات مشاهدة
التخطي إلى أول رسالة غير مقروءة

Prashant Jain

غير مقروءة،
02‏/10‏/2012، 6:27:11 م2‏/10‏/2012
إلى js-test...@googlegroups.com
I keep getting the above error. There are times when I don't get this error but most of the time I do. Please see the attached screen shot.

I have recommended JSTestDriver to my team. But I am now noticing that it is unstable and unpredictable. My stubbed functions are called and sometimes they are not. I get the JSON parse error and sometimes I don't. 

I am almost at a point where I am exploring headless QUnit. 
Screen shot 2012-10-02 at 3.13.30 PM.png

Cory Smith

غير مقروءة،
03‏/10‏/2012، 6:40:58 م3‏/10‏/2012
إلى js-test...@googlegroups.com
The screenshot really isn't helpful for reproduction. Do you have anything else?
> --
> You received this message because you are subscribed to the Google Groups
> "JsTestDriver" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/js-test-driver/-/m2bfROF3A5AJ.
> To post to this group, send email to js-test...@googlegroups.com.
> To unsubscribe from this group, send email to
> js-test-drive...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/js-test-driver?hl=en.

Vitali S.

غير مقروءة،
21‏/03‏/2013، 8:57:55 ص21‏/3‏/2013
إلى js-test...@googlegroups.com
Hi,

I think the problem is the content to are going to parse into a JSON object. Try it with some other content.
Please see the following post http://stackoverflow.com/questions/9492916/putting-html-in-json
and also http://www.json.org/

Vitali

Cory Smith

غير مقروءة،
21‏/03‏/2013، 9:04:05 ص21‏/3‏/2013
إلى js-test...@googlegroups.com
It's more of a question about *when* it happens. I still need more
information to reproduce the issue.
> --
> You received this message because you are subscribed to the Google Groups
> "JsTestDriver" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to js-test-drive...@googlegroups.com.
>
> To post to this group, send email to js-test...@googlegroups.com.
> Visit this group at http://groups.google.com/group/js-test-driver?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Baz

غير مقروءة،
21‏/03‏/2013، 1:12:10 م21‏/3‏/2013
إلى js-test...@googlegroups.com
It's pretty obvious from that screenshot (if you've messed with web
services before). It's trying to parse json, but "data" is html (not
json with html in it - it's just html). The most common cause of this
is serving json from an endpoint where all the error responses (404,
500, etc) are html, and the js handling the response ignores the code;
or worse, that errors are funneled through an error page which serves
a 200 response code.

So the wrong thing is being passed into jQuery.parseJSON(data). What's
the stacktrace? Have you looked at the content of 'data' to see what
html you were trying to parse? I'm guessing it's going to be an error
page and its contents will be a big clue as to what's wrong here.

-B
الرد على الكل
رد على الكاتب
إعادة توجيه
0 رسالة جديدة