开发者

HTML5 localStorage across files?

Is HTML5 storage shared across other HTML files?

For example if I have files..

index.html and index2.html and I set a key info equal to null in index can I retrieve this value in in开发者_Go百科dex2.html? If not, is there anyway of doing this?


You have one localStorage object per origin, the origin being the combination of protocol, host and port. See http://en.wikipedia.org/wiki/Same_origin_policy. So if all your HTML files come from the same protocol/host/port, then they will share the same localStorage.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜