刷新帧并跳转到锚点

发布于 2024-10-06 08:02:50 字数 347 浏览 1 评论 0原文

我无法先刷新框架,然后跳到锚点。我在 onClick 事件中放置命令的顺序似乎没有什么区别。我什至试图将它们拉出到一个函数中,但无济于事。

<input type="button"
onclick="edit_form.edit_mode.value=1;
edit_form.submit();
top.settings.location.reload();
top.settings.location='index.php?fuseaction=admin.displayCallReportSettings#3';"
value="Save"
name="save_button">

这可以吗?

I am unable to get the frame to refresh first, THEN jump to the anchor. The order I put the commands in the onClick event seems to make no difference. I even tried to pull them out into a function to no avail.

<input type="button"
onclick="edit_form.edit_mode.value=1;
edit_form.submit();
top.settings.location.reload();
top.settings.location='index.php?fuseaction=admin.displayCallReportSettings#3';"
value="Save"
name="save_button">

Is this possible to do?

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

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

发布评论

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

评论(1

烈酒灼喉 2024-10-13 08:02:50

这是因为您正在启动框架重新加载,并立即发出命令以转到另一个网址。您必须分配 onload 处理程序并将该锚点滚动到那里的视图中。

This because you are initiating frame reload, and immediately issuing command to go to another url. You have to assign onload handler and scroll that anchor into view there.

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