保存的内容在本地存储中
我想将 的内容保存在本地存储中并重复使用。我怎样才能做到这一点?我想让链接保持有效。我想用它来链接到网络应用程序(用户提供),并且我想通过本地存储来实现这一点(我正在构建一个供个人(也许)公共使用的在线操作系统,它不会像eyeos或jolicloud那么大)。
I want to save the content of the <a href>
In the localstorage and reuse it. How can i do that? I want to keep the link working. I want to use it to link to webapps (user provided) and i want to achieve that with the localstorage (i am building an online os For personal(and maybe) public use it won't be as big like eyeos or jolicloud).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您想保存整个链接(包括属性):
您可以创建自己的函数来动态添加更多链接(甚至图像)到容器中,这些链接在离开页面时自动保存,并在访问页面时再次显示。
另请参阅:https://developer.mozilla.org/en/DOM/Storage
If you want to save the whole link (including attributes):
You can create your own functions to dynamically add more links (even images) to the container, which are automatically saved when leaving the page, and shown again when visiting the page.
See also: https://developer.mozilla.org/en/DOM/Storage
为什么不直接获取 URL
,然后将其存储在 key(i) 的值中呢?我知道这听起来太简单了,但这就是您要问的......不是吗?您只需要一个用于检索的命名系统。
Why not just grab the URL
and then store it in the value for key(i)? I know that sounds too simple, but that is what you are asking... isn't it? You would just need a naming system for retrieval.