保存cookie的HTML [英] Save html in cookie

查看:142
本文介绍了保存cookie的HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用jQuery克隆和一些HTML追加到一个div。

I am using jquery to clone and append some html into a div.

我的问题是刷新页面时,这个网站将被删除。现在的问题是我怎么可以保存附加HTML中的DIV(在html code将包含一些投入,并选择列表,将有大量code的)。

My problem is that this html will be removed when the page is refreshed. The question is how I can save the appended HTML in the div (the html code will contain some inputs and select lists and there will be plenty of code).

我应该怎么考虑?

饼干?

HTML5?

还有别的吗?

推荐答案

如果你只支持现代浏览器我会去HTML5的离线存储。

If you're only going to support modern browsers I would go for HTML5's offline storage.

另一种方法是,以获得的AJAX路线

Another approach would be to get the AJAX route.

您不想使用cookies为此,bacause:

You don't want to use cookies for this, bacause:

饼干得到在每一个请求加载

cookies get loaded at every request

饼干只能容纳的信息量有限。

cookies can only hold limited amount of information.

这篇关于保存cookie的HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆