Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

json.stringify undefined in IE7 #85

Open
pkrumins opened this issue Nov 30, 2015 · 2 comments
Open

json.stringify undefined in IE7 #85

pkrumins opened this issue Nov 30, 2015 · 2 comments

Comments

@pkrumins
Copy link

Hello there,

Today at Browserling I had to debug an issue for a customer in IE7. He was using socket.io (latest v1.3.7), that uses json3.

I found out that in IE7 json.stringify is undefined, however json.JSON.stringify is defined.

Here's a screenshot from debugger attached to IE7 that shows the problem (it's in socket.io-client.js):

image

I'm not sure if it's json3 issue, or socket.io-client.js issue, but as a workaround I'm simply using json.JSON.stringify in that place. I thought I'd let you know.

P. Krumins

@bnjmnt4n
Copy link
Member

Hi, I'm not too sure how socket.io imports JSON3 and uses it, but typically it should be available as JSON.stringify (uppercase, not lowercase). Does that work for you? We also export it as JSON3.stringify too for browsers, unless the socket.io client uses some code compiler like browserify/webpack.

@pkrumins
Copy link
Author

The code works in IE8 and newer IEs, it's just it doesn't work in IE7. I'm not familiar how socket.io-client imports JSON3 either. That screenshot is from socket.io-client. Here is that place on github:

https://github.com/socketio/socket.io-client/blob/d125da3c0fb05c9bc958a501b102f73d0e552a72/socket.io.js#L5872

I haven't tested if JSON.stringify works as I found a workaround via json.JSON.stringify for IE7 (I live patched client's socket.io.js.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants