问题标签 [back]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
4105 浏览

javascript - 复选框值的持久性

我有一个带有几个复选框的页面。我检查了其中一些并转到下一页,当我回到此页面时,这些复选框需要保持选中状态,然后才能导航到另一个页面。需要用Javascript来做。有什么线索吗??

0 投票
1 回答
979 浏览

asp.net-mvc - mvc 和后退按钮

我是 mvc 的新手,所以我不知道这是否有技巧。当用户在我正在构建的网站上运行搜索并将他们带到结果页面时,如果我单击后退按钮,则搜索表单为空。有没有办法让表单字段保持返回时的状态(不诉诸会话)?谢谢。

0 投票
1 回答
561 浏览

javascript - 后退按钮后未禁用 Javascript 禁用的组件

当用户单击复选框时,我正在禁用单选按钮组,仅使用原始 javascript 和 disabled 属性。

我的功能很简单:

并使用 onClick 事件调用它,例如 onClick="toggleEnabled('radio_div')"

它工作得很好,但是如果用户单击返回,浏览器似乎会记住复选框的状态,但会将 div 中组件的状态重置为它们原来的状态。

这是在 IE7 中,我现在不想使用 JS 库,所以请不要提出任何建议。

难道我做错了什么?是否有获得预期行为的解决方案(记住复选框和返回上的 div 的状态)?

0 投票
6 回答
2417 浏览

php - PHP: Stop a Form from being accidentally reprocessed when Back is pressed

What is the best way to stop a form from being reprocessed when a user hits a Back button?

I'm following the Post/Redirect/Get pattern, so I don't have a problem if F5 is pushed, but the back button still provides the opportunity to resubmit the form. If this form is a credit card processing page, this is bad.

This question has been asked somewhat here, but the phrasing and answers were of poor quality and not specific to this problem exactly.

I have form.php which submits to itself. If there were no errors in input data upon submission, the user is redirected to form_thanks.php. Hitting back (and "Send" or "Resubmit") once resubmits form.php (BAD!) and then brings them back to form_thanks.php.

Please also include solutions that do not involve using Sessions, if possible.

0 投票
4 回答
1943 浏览

asp.net - 如何在asp.net mvc应用程序中检查哪个事件导致回发

我的 ASP.net MVC 应用程序中有一个视图和一个控制器。

我的视图中有一个“提交”按钮和一个“取消”按钮。

当我单击下面的任何按钮时,将触发操作。

AcceptVerbs(HttpVerbs.Post)

公共 ActionResult 结果()

{

}

现在的问题是我将如何在我的公共 ActionResult Result() 中知道是否由于“提交”或“取消”而导致回发?

0 投票
1 回答
673 浏览

iframe - 带有 IFRAME 的后退按钮循环

在我的(学校)网站中,我们使用 iframe 来显示班级博客(在博客上)。除非用户随后单击(例如)iframe 内的照片,否则此方法效果很好。Blogger(在这种情况下)然后在整个浏览器窗口中显示照片并循环返回按钮;也就是说,如果点击后退按钮,浏览器(IE、FF、Chrome)将停留在同一页面上。唯一的出路是让用户跳回两页(我们的许多用户不知道该怎么做)。我已经阅读了很多关于后退按钮和 iframe 的帖子,但似乎没有一个简单的解决方案。请记住,我无法控制 iframe 内容(因此框架中没有嵌入的后退按钮)。任何人的想法?

0 投票
6 回答
5915 浏览

javascript - 使用 BACK 按钮恢复到页面的先前状态

我正在为我的网站尝试新功能。<div>我想通过隐藏/显示元素来做简单的导航。

例如,当用户单击某个产品上的“详细信息”按钮时,我想隐藏主要内容<div>并显示<div>包含该产品详细信息的内容。

问题是要返回上一个“页面”,我必须撤消所有显示/可见性样式更改,如果用户单击新打开的“关闭”按钮,则可以<div>。但大多数用户会点击 BACK 按钮。

有没有办法让 BACK 按钮回到页面的先前“状态”,即撤消可见性/显示更改?

谢谢。

0 投票
1 回答
1850 浏览

button - JSF 1.2 Go Back hyperlink

I have two forms. On Form 1, I have this screen layout:

When I click a link on Form 1, for example, hyperlink 1, this takes me to Form 2. From Form 2, I have a link called "Go Back" to go back to Form 1. Usually, I would just use

to navigate back. However, doing this means JSF resets all my form's values when I get back to Form 1 from Form 2. I want to return to the previous Form 1's view i.e. showing the detail section with data as opposed to a blank detail section.

I have also tried this - for each hyperlink in the detail section on Form 1, I have this code:

And in Form 2, I have this code:

The above parameters will be passed back to Form 1 for processing. While this is working, I'm not sure if this is the best way to do it with JSF 1.2.

Any expert here know of a better (more robust) method of creating a "Go Back" button? Example demo codes would be greatly appreciated as I have been stuck on this one for about a week now...

0 投票
4 回答
3801 浏览

actionscript-3 - 如何从形状/图形对象中读取数据

我想知道是否可以使用 actionscript 3 获取存储在 flash 中的形状/图形对象中的数据?

在我的项目中,我希望能够绘制一个形状,然后将该形状中的所有点读入我的脚本中。这样做的原因是我需要从这些点生成线条,以便以后可以用来检查我的角色速度是否与其中任何一个相交。

0 投票
4 回答
8531 浏览

button - Struts2 back button and linking

I am using Struts 2.1.6 with Dojo plugin, whole app has ajax links (sx:a).

Did anybody succeed to implement back button functionality and linking to certain content?

Does anybody have any experience how to implement? I am planning to implement (if there is no good solution already) something like so:

  • changing address bar link (adding parameters) with js which I can then read and get proper content and then publish it with notifyTopics.

Or should I just change whole app to use jQuery plugin? Do jQuery has good solutions for back button and linking on ajax pages?