我可以让 javascript 在另一个页面加载后自动点击该页面上的链接吗?

发布于 2024-11-29 12:11:59 字数 96 浏览 1 评论 0原文

我想在页面 A 上创建一个链接到页面 B 的链接,并在页面 B 加载完成后单击页面 B 上的链接。这是可能的还是我必须在应该单击链接的特定页面上编写 JavaScript 代码。

I want to create a link on page A that links to page B and also clicks on a link on page B once page B has finished loading. Is this possible or would I have to code javascript on that specific page where the link is supposed to be clicked on.

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

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

发布评论

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

评论(2

囚你心 2024-12-06 12:11:59

如果您只是想重定向到另一个页面,您可以检查网站上的 document.referrer 以查看此人来自何处 (url),然后使用 location.replace("http: //example.com/myformpage.htm")

If you simply want to redirect to another page you can check the document.referrer on your site to see where the person came from (url) and then redirect with location.replace("http://example.com/myformpage.htm")

赤濁 2024-12-06 12:11:59

你是对的,JS 几乎是在包含的环境(即原始页面)中运行的。

You're right, JS is pretty much run in contained environment (i.e., the original page).

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