JSON in IE/Opera

P

paladin.rithe

I was playing around with the JSON AJAX Chat tutorial at
dynamicajax.com, and got it working ok. Now, it should be said that my
main browser is FF2. Anyway, I decided to run it in IE and Opera to
see what happened... Nothing. The page comes up, but nothing
displays. I know that they can send information, it shows up in FF,
but nothing is recieved. I checked what errors I could (and knew how
to check, I don't use either enough to be really familiar) and it looks
like it can't parse the JSON being sent back.
All that's being done is: eval( '(' + responseText + ')' ). Everywhere
I've seen says that this is how you do it (outside of using another
parser). Is there an issue with doing this in IE and Opera? I haven't
been able to find anything otherwise, so I'm not sure. Oh, I should
say that I'm running IE 7, and Opera 9.

Brian

And I'm sorry if this double posts. Apparently I wasn't logged in the
first time, even though I thought I was.
 
F

Frederik Vanderstraeten

(e-mail address removed) schreef:
I was playing around with the JSON AJAX Chat tutorial at
dynamicajax.com, and got it working ok. Now, it should be said that my
main browser is FF2. Anyway, I decided to run it in IE and Opera to
see what happened... Nothing. The page comes up, but nothing
displays. I know that they can send information, it shows up in FF,
but nothing is recieved. I checked what errors I could (and knew how
to check, I don't use either enough to be really familiar) and it looks
like it can't parse the JSON being sent back.
All that's being done is: eval( '(' + responseText + ')' ). Everywhere
I've seen says that this is how you do it (outside of using another
parser). Is there an issue with doing this in IE and Opera? I haven't
been able to find anything otherwise, so I'm not sure. Oh, I should
say that I'm running IE 7, and Opera 9.

Brian

And I'm sorry if this double posts. Apparently I wasn't logged in the
first time, even though I thought I was.

Could you provide us with a simple test case which fails?
 
P

paladin.rithe

Frederik said:
(e-mail address removed) schreef:

Could you provide us with a simple test case which fails?

I uploaded it to show my brother the other day, so I should be able to
show it to you exactly. It's located at:
http://brian.radioactivepickles.us/chat/ Just enter your name, and
away you go. Unless it happens to work for you in one where I've had
no luck, there should be a black pane where the chat should show up.
In FF, you'll get all the messages, and then it keeps polling to see if
there are any more. The others poll, and get stuff (as far as I can
tell), but it doesn't like the JSON. Hopefully someone can tell me
what I did wrong. Thanks.
 
M

Michael Winter

(e-mail address removed) wrote:

[snip]
http://brian.radioactivepickles.us/chat/ Just enter your name, and
away you go. Unless it happens to work for you in one where I've had
no luck, there should be a black pane where the chat should show up.
In FF, you'll get all the messages, and then it keeps polling to see if
there are any more. The others poll, and get stuff (as far as I can
tell), but it doesn't like the JSON.

The generated object literals are incorrect: the last property
name/value pair is followed by a comma. This is not allowed.

You also trail a comma in the array literal. This is permitted, if a
little sloppy.

Mike
 
P

paladin.rithe

(e-mail address removed) wrote:[snip]
http://brian.radioactivepickles.us/chat/ Just enter your name, and
away you go. Unless it happens to work for you in one where I've had
no luck, there should be a black pane where the chat should show up.
In FF, you'll get all the messages, and then it keeps polling to see if
there are any more. The others poll, and get stuff (as far as I can
tell), but it doesn't like the JSON.The generated object literals are incorrect: the last property
name/value pair is followed by a comma. This is not allowed.

You also trail a comma in the array literal. This is permitted, if a
little sloppy.

Mike

Ahh, I found it. I just need to get rid of the one in the array now,
but otherwise, it's working. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top