Nice... worth noting, you should stick to compact line-delimited JSON when using this technique... I'd also look into websockets as another alternative, especially if you want bidirectional data streams.
Another consideration, you should use local storage and/or site messages to reduce the number of long lived, persistent connections to a single server, especially if your users are likely to have multiple tabs open to a website/app. Most browsers limit you to 6 simultaneous connections, so using the technique above without accounting for this behavior can cause issues with multiple open tabs.
For example, I'll assign a random id to the current browser/tab and then negotiate a "leader" as the active browser tab, or last active browser tab on activation, and that leader will be the one with the persistent connection, then updates can be fed into local-storage so the data/state can be used across multiple tabs. This can be used for things like notifications or interactive chats, such as on Facebook or LinkedIn.