Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,11 @@ function checkData() {
chunk = response.slice(previous_response_length);
previous_response_length = response.length;
console.log(chunk);
//if you get messages faster than you can parse one at a time- convert to valid json first
var replacedChunk = chunk.replace(/}{"SUBSCRIBE":/g, '},{"SUBSCRIBE": ');
var validJSON = '['+replacedChunk+']'
var json = JSON.parse(validJSON);
console.log(json);
}
};
</pre>
Expand Down