For a UI feature, I need to read from a Windows Azure queue and update the UI accordingly.
I see plenty of node.js examples, but nothing using pure Javascript or Jquery. (azureQuery comes close, but no queue functionality yet and it needs a Web API to talk to)
This is a hybrid web app using both asp.net and MVC 4. This particular page is generated using MVC 4.
Any suggestions would be appreciated.
Roberto
(PS. being able to write to the queue would also be nice)
This isn’t possible directly from the browser. JavaScript in the browser has to follow the same-origin policy, which means that JavaScript can only make calls to the domain of the current web page. Since your web page won’t be served from
<account>.queue.windows.net, it means your JavaScript won’t be able to call APIs on that domain. (This would be possible in most browsers if the queue service served up CORS headers, but it doesn’t.)You’ll need to host a web endpoint (in your MVC 4 app, probably) that proxies queue messages. Your JavaScript will send a message to your web app, and your web app will put the message on the queue.