0

This is just a curiosity question: I am wondering how Firebase's JavaScript API syncs data. It doesn't require any server side code, so the work is all done by the client. However, it needs to retrieve data from an external url (https://<my-firebase>.firebaseio.com).

I thought that AJAX requests can only be made to the same domain, and that JavaScript cannot access <iframe>'s without a domain, protocol, or port matching the parent page.

So how does Firebase work?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
DankMemes
  • 2,085
  • 2
  • 21
  • 30
  • Cross-site requests are possible from modern browsers if the server sets up the right HTTP headers. [Reference](https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS) – Pointy Jan 03 '14 at 23:56
  • Also, from my own observation, I notice that Firebase uses websockets when possible – Mike Pugh Jan 04 '14 at 00:49

0 Answers0