For HTML5 local storage, do I need openDatabase?
I've been playing around with HTML5 local storage, using localStorage.getItem("something") and localStorage.setItem("something","somevalue") and i开发者_运维百科t's working just fine. Of course it's all conditional upon the localStorage window object existing.
I'm only storing one string, so I'm wondering whether I need this openDatabase call that I've read about. Half the examples I've found don't mention it at all, the other half seem to imply that it's a basic part of using local storage.
While I'm here, is local storage cross-domain or is it tied to the domain of the site from which it was stored?
Nothing I've ever looked at concerning localStorage mentioned openDatabase
. That's probably for webSQL storage, which isn't really used much, and only works in Safari/Chrome.
LocalStorage is same-domain, just like ajax calls.
精彩评论