• About Us
  • Blog
  • Basket
  • Account
  • Sign In
  •  

Blog

16

Aug

2012

How to use XMLHttpRequest and XDomainRequest to stream messages

Our PHP device detection API includes a feature to update the rules and data used to identify requesting browsers, operating systems and hardware via a single PHP script (51Degrees.mobi.update.php). Plug-in developers want to use this script to provide a simple button to update the device data from within their favourite CMS' administration interface. However our update script simply writes status messages back to the browser as plain text. Some browsers don't display these messages as they arrive, instead waiting until the entire message has been received. This is no good if we want to provide the user update status messages as the update is happening. For example; "Calculating Delta" or "Verifying Changes". We therefore need a method to display these messages as they arrive. This blog explains a surprisingly simple solution.

Comments (0)
Read more

Categories: Development

Tags: HTTP

RSS