浏览器返回buuton() [英] browser back buuton()

查看:116
本文介绍了浏览器返回buuton()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



我试图让浏览器返回按钮返回到特定的上一页。我在我的v.aspx.cs中使用了javascript函数,但它不起作用。它是直接返回到上一页,而不是我可以指定的特定页面的主页。我该怎么办???

解决方案

你不应该重定向Back,因为这会让用户大为困惑。你不应该打破最基本的用户对导航的期望。



同时,你可以禁用后退操作,这是通常的技术,有很多文章解释如何做到这一点。请参阅: http://www.sitekickr.com/blog/back-button-browser-cache [ ^ ]。



另外(或另外),您可以处理事件beforeunload以通知用户和/或请求确认:

https://developer.mozilla.org/en-US/docs/Web/Events/beforeunload [< a href =https://developer.mozilla.org/en-US/docs/Web/Events/beforeunloadtarget =_ blanktitle =New Window> ^ ]。



也许如果你解释最终目的,你可以得到其他建议。



-SA

hi everybody

i am try to make browser back button to return to specific previous page. i was use javascript function inside my "v.aspx.cs" but it was not work. it was return me to the previous page directly not to home page of specific page that i can assign. what can i do???

解决方案

You should not redirect "Back", because it would greatly confuse the user. You should not break the most basic user expectations on navigation.

At the same time, you can disable "back" operation, which is the usual technique, there are many articles explaining how to do that. Please see: http://www.sitekickr.com/blog/back-button-browser-cache[^].

Alternatively (or additionally), you can handle the event "beforeunload" to notify the user and/or request confirmation:
https://developer.mozilla.org/en-US/docs/Web/Events/beforeunload[^].

Perhaps if you explain the ultimate purpose, you can get other suggestions on what to do.

—SA


这篇关于浏览器返回buuton()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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