一旦该页面加载,我可以让javascript自动点击另一页面上的链接吗? [英] Can I get javascript to automatically click on a link on another page once that page loads?

查看:222
本文介绍了一旦该页面加载,我可以让javascript自动点击另一页面上的链接吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在页面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.

推荐答案

如果你只想重定向到另一个页面,你可以检查你网站上的 document.referrer ,看看这个人来自哪里(网址),然后用 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")

这篇关于一旦该页面加载,我可以让javascript自动点击另一页面上的链接吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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