Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[atmosphere.js] JSONP not working #1090

Closed
jfarcand opened this issue May 14, 2013 · 5 comments
Closed

[atmosphere.js] JSONP not working #1090

jfarcand opened this issue May 14, 2013 · 5 comments

Comments

@jfarcand
Copy link
Member

The new atmosphere.js script (the one without jquery) fail on the second request when using JSONP as transport. The same error occurs with portal.js.

@flowersinthesand
Copy link
Member

When executing portal's test suite, it turns out longpolljsonp that is a transport name in the portal of JSONP works correctly. With the chat sample from atmosphere-samples and 'jsonp' transport, first jsonp request's response is as follows.

atmosphere1378902554401({"message" : "53|{"message":"fef","author":"fef","time":1378902556941}"});

As you can see the above code's color, this is malformed JavaScript code.

After modifying this correctly and executing it in the console, I was able to see that next request fires and its response is wrongly formatted.

@jfarcand
Copy link
Member Author

Ah! OK let me fix that.

@jfarcand
Copy link
Member Author

OK I think I'm missing something. Event if I force Jackson to encore the time in String (that shoudn't make any difference

atmosphere1378904720644({"message" : "59|{"message":"dsada","author":"dsada","time":"1378904722083"}"});

I still see an error. Is it because of the '|' . Doing the same with jQuery seems to work so I'm a little puzzled.

@flowersinthesand
Copy link
Member

This is the expected result, and of course the time property is not problem.

atmosphere1378902554401({"message" : "53|{\"message\":\"fef\",\"author\":\"fef\",\"time\":1378902556941}"});

With the latest jquery.atmosphere.js, I see the same error.

jQuery190069097618936723_1378906773365({"message" : "53|{"message":"aaa","author":"aaa","time":1378906779316}"});

@jfarcand
Copy link
Member Author

OK closing the issue, will re-open another one as it work with the jersey-pubsub sample.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants