Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.8k views
in Technique[技术] by (71.8m points)

form表单跳转网页,获取来源referrer失败?

客户有个门户系统,和一个内管系统,需要在门户系统登录后,点击内管系统按钮,单点登录到内管系统。但是门户系统是用form表单跳转到内管系统,内管系统用js的?document.referrer 或者?window.opener.location.href 都无法获取来源url,想问下有没有办法获取在不改变form表单跳转的前提下,用js获取来源url?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

可以考虑自己主动跟一个参数在跳转尾巴里,比如表单触发跳转的时候请求跳转地址是XXXX.com?refer=XXX.com 然后跳过去后用JS拿这个小尾巴的值获取refer


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...