如何只刷新一次页面 [英] how to refresh a page only once

查看:79
本文介绍了如何只刷新一次页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我想通过点击浏览器后退按钮来浏览页面A.


我正在使用 

 

位置 reload ();

它无限清爽。如果我应用某些条件,那么同样的事情也会发生。

解决方案是什么?

问候

Pawan

解决方案

没有内置 - 在方法中,告诉您之前您的页面在哪里,但您总是可以
设置cookie 在您的母版页上记录当前网址,这样您就可以在新网站覆盖
之前,通过阅读存储的网址的Cookie来了解您之前的位置。

Hi all,

I want to refresh the page A when I comes to Page A by clicking browser back button.

I'm using 

location.reload();

but it is refreshing infinitely. If i apply some condition then also then also same thing is happening.

What is the solution?

Regards

Pawan

解决方案

There's no built-in method that tells you where have your page been before, but you can always set cookie at your masterpage to record the current URL, so you can find out where have you been before by reading the cookie for your stored URL before it has been overwritten by the new one.


这篇关于如何只刷新一次页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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