It's possible to do it that way, but it adds some annoying constraints. If you're accessing data locally, it would have to go through a remote server, which causes latency and privacy concerns.
Alternately you are trying to access local personal data using a remote app - so you need Google's or HTML5's support for a local database (SQLight I think but in a wrapper).
NOTE: I wouldn't use this approach, and there's probably better ways, but I can see the potential benefits of it.