我的页面在第一次点击时更新但不刷新

发布于 2024-11-06 11:35:14 字数 442 浏览 6 评论 0原文

我有一个几乎可以正常工作的 php 文件。但每次管理员单击批准/不批准链接时,它都不会刷新页面。事情是这样的:

当 IT 人员将文件上传到页面时,管理员可以看到该文件(管理员检查上传的文件并决定是否接受上传的文件)。事情是这样的,管理员会获得一个用于批准和不批准的新表列,当管理员单击批准链接时,数据库会更新,并且与 NotApprove 链接相同。两者唯一的区别是内容(Approve,另一个NotApprove)。所有代码都可以正常工作,除了一件事,当您单击链接一次时,它不会重新加载,尽管它在第一次单击时更新。

有办法解决这些问题吗?或者是否有办法刷新页面而不会对更新/删除链接造成问题?我已经尝试了位于链接内的 onclick = "opener.location.reload()" 。单击链接时页面会重新加载,但数据不会更新。

感谢那些提供帮助的人:)

注意** 案例已解决,但感谢您的帮助:)

I have a php file that almost work properly. But then it wouldn't refresh the page everytime the admin clicks the approve/notapprove link. so here's the thing:

when an IT upload a file to the page, the file could be seen by the admin(who checks the uploaded file and decides whether the uploaded file is accepted or not). here's the thing, the admin is given a new table column for the approve and not approve, when the admin clicks on the approve link, the database is updated and same goes with the NotApprove link. the only difference between the two is the content (Approve, the other NotApprove). all codes works properly except for one thing,when you click on the link once, it wont reload,although it is updated on the first click.

is there a way to fix these? or is there anyway to refresh the page without causing problem to the update/delete links? i have tried the onclick = "opener.location.reload()" locaed inside my links. the page reloads when you click on the link but the data does not update.

thank you for those who help :)

NOTE** case solved but thanks for the help :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

肥爪爪 2024-11-13 11:35:14

您的问题可能与页面未刷新以及浏览器显示缓存版本有关。尝试添加一些标头:

<meta name="pragma" content="no-cache" />

或添加过去的过期日期:

<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">

Your problem might have something to do with the page not being refreshed and the browser showing a cached version. Try adding some headers:

<meta name="pragma" content="no-cache" />

or add an expire date in the past:

<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
丢了幸福的猪 2024-11-13 11:35:14

您可能有缓存版本,因此在加载页面时传递参数时添加一个随机数作为应该从 javascript 生成的参数。这将忽略缓存并在传递您的值时加载新内容。

另一种方法是使用 AJAX 来执行相同的任务(这里您也应该使用随机数作为参数以避免缓存)。

you may have cached version, so while loading the page when passing parameter add one random number as parameter which should generate from javascript. That will ignore the cache and load the fresh content as passing your values.

The alternate method is using AJAX to do the same task (here too you should use random number as parameter to avoid cache).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文