Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个加载登录页面的页面,在用户登录后,它会将另一个文件的某些部分加载到自身中。问题是我想知道在第一页中按下了哪个按钮并将其放在登录页面中。第一个页面使用加载登录页面location.window并刷新页面。有没有办法做到这一点?
location.window
或者,您可以利用 cookie/HTML5 localStorage 来跟踪页面 url。
如果您使用的是 FORM,那么您可以在隐藏字段中发送按钮信息,例如
<input type="hidden" name="track" value="but1">
或者如果您使用 GET 方法,您可以通过查询字符串发送信息,例如
http://domain/login.php?track=but1