Go Back   CodingForums.com > :: Client side development > JavaScript programming > DOM and JSON scripting

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-02-2010, 03:10 PM   PM User | #1
kkudi
New to the CF scene

 
Join Date: Aug 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
kkudi is an unknown quantity at this point
IE 7/8 parsererror (json)

Hi everyone

I'm in the middle of identifying why IE7 and IE8 produce an error when a lot of data is returned on the client side.

There's an AJAX call which queries a database, loops through the results and creates a json object ( using the JSON library for Java).

Now on the client side ( javascript) I loop through each "row" and print the result.

Using firebug's response I copy the entire string and check with jsonlint and the json returned shows as valid.

With Firefox, Safari and Opera I get no errors whatsoever when the json is processed.

With IE7/IE8 when the resuls are somewhat greater (don't know the exact number) than 1850 I get a parsererror.

Any idea why this might be happening?

The returned string from the servlet is a json object "rows" which is a JSONArray and javascript loops through each element and processes the results.

When debugging in IE, the ajax call does goes directly to the error callback function and not the success callback function.
I'm using jquery 4+


Any suggestions/advice/solution are welcome
Thanks

Andreas
kkudi is offline   Reply With Quote
Old 08-02-2010, 04:26 PM   PM User | #2
kkudi
New to the CF scene

 
Join Date: Aug 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
kkudi is an unknown quantity at this point
Figured out why.

for anyone, out there wondering what the problem was:


It turned out that some of my data had non-ascii characters, (french, german etc),

Firefox and Safari were showing these as question marks. IE would give a parsererror.

Changing my servlet's response character encoding to UTF-8 fixed everything..
kkudi is offline   Reply With Quote
Old 01-19-2011, 11:48 PM   PM User | #3
mikequetzal78
New to the CF scene

 
Join Date: Jan 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
mikequetzal78 is an unknown quantity at this point
Question

Hi kkudi

How do you change your servlet's response character encoding to UTF-8 fixed everything?

Regards!!!
mikequetzal78 is offline   Reply With Quote
Reply

Bookmarks

Tags
java, javascript, jquery, json

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:04 PM.


Advertisement
Log in to turn off these ads.