1

I am writing a web application for my company. The company has a server that I have to use and I can not change anything on the server side.

When I send an HTTP GET request I get a stream of XML as response, i.e. the HTTP connection remains opened until it is closed manually. When I test the request in my browser I immediately get the response which is updated automatically every time the data changes (and because it is a stream, the loading animation of the browser keeps running).

How can I handle the response in javascript? Is there any way I can get notified when the data changes? I have done research for available frameworks to handle this but without any luck.

Mark Buikema
  • 2,483
  • 30
  • 53
  • You will need to set up an interval and Ajax the data and compare to previously gotten data – mplungjan Apr 10 '14 at 08:49
  • Is there no way to get notified when the data has updated rather than polling the data everytime? It is a stream, not a regular response. – Mark Buikema Apr 10 '14 at 09:10
  • You may want to use notifications, loot at [this answer](http://stackoverflow.com/questions/9106516/push-notifications-from-server-to-user-with-php-javascript) that may help you out dude ! – user3241019 Apr 10 '14 at 09:35

1 Answers1

0

There is a SAX parser written in JavaScript which would be useful in an architecture such as:

  • Company Server
  • WebSocket stream
  • Sax.js

References

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265