如何在浏览器上保留使用ajax调用生成的html内容? [英] How to retain the html content generated using ajax call on browser back?

查看:69
本文介绍了如何在浏览器上保留使用ajax调用生成的html内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个html页面,其内容是在页面加载时使用ajax调用生成的。

因此,当请求页面时,内容是可见的。但是当我转到下一页然后单击浏览器后退按钮时,内容就会丢失。

你能帮我保留相同场景中的内容。

谢谢



我尝试了什么:



我正在使用ajax调用然后使用

I have a html page whose content is generated using ajax call on page load.
So when the page is requested the content is visible. But when I go to the next page and then click browser back button then the content is lost.
Can you help me to retain the content in the same scenario.
Thanks

What I have tried:

I am using ajax call then assigning the output to a div using

$('#doc-content').html(data);

推荐答案

('#doc-content')。html(data);
('#doc-content').html(data);


这篇关于如何在浏览器上保留使用ajax调用生成的html内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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