当对同一页面进行操作时,保留页面位置? [英] When form action to same page, retain page position?

查看:69
本文介绍了当对同一页面进行操作时,保留页面位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我当前的项目中,用户在他们正在编辑的内容上单击保存更改,并且它进一步向下弹出编辑框,保存文本等的页面。有没有办法让网站保留其页面位置,以便将它们自动滚动回到他们点击的位置编辑?

On my current project, the user clicks on "Save Changes" on what they are editing, and it is further down the page where the edit box, saved text, etc... pops up. Is there a way I can have the site retain its page location in order to auto-scroll them back down to where they clicked edit?

理想情况下,我会有一些类型解决方案的页面不必重新加载,但我不知道该怎么做,大声笑。

Ideally I'd have some type of solution where the page wouldn't have to reload but I don't know how to do that, lol.

我的网站使用PHP编码。

My site is coded in PHP.

谢谢

Thanks

推荐答案

您可能想查看一些关于如何通过AJAX保存表单的教程。这意味着你不在POST页面,因此它不会刷新,并且用户不会失去在页面上的位置。

You might want to have a look at some tutorials on how to save a form via AJAX. This will mean you aren't POSTing the page, and therefore it won't refresh and the user won't lose their position on the page.

http://www.jstiles.com/Blog/How提交表单与jQuery和AJAX

http://www.devblog.co/easy-jquery-ajax-php-contact-form/

这篇关于当对同一页面进行操作时,保留页面位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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