开发者

For HTML5 local storage, do I need openDatabase?

开发者 https://www.devze.com 2023-03-18 03:46 出处:网络
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 cours

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消