0

This is probably a very simple question so please forgive my ignorance, but can a Web SQL database be read across pages of the same domain?

For example if I insert data on page mydomain.com/createdata can the same data be queried on mydomain.com/readdata ?

Thanks in advance!

MeltingDog
  • 14,310
  • 43
  • 165
  • 295
  • wrt. *subdomains*, see: http://stackoverflow.com/questions/4177803/can-html5-databases-and-localstorage-be-shared-across-subdomains?rq=1 –  Jun 20 '12 at 23:18
  • (Also, I think IndexedDB is the "endorsed" W3C model... so browser support on Web SQL may be less complete going forward?) –  Jun 20 '12 at 23:21

2 Answers2

3

It's local browser storage then no problem to read this form any page of the same domain. It is designed especially for it. The problem appear when you need to share Web SQL database across different domains, in this case you should deal with Same Origin Policy

odiszapc
  • 4,089
  • 2
  • 27
  • 42
1

Yes. Within the same domain is no problem. I believe there is a 5MB limitation on the storage capacity per domain.

For examples and reference code, check html5Rocks - Storage

Ben Ripley
  • 2,115
  • 21
  • 33