简体   繁体   English

如何在新页面中打开链接,然后从第二个页面链接回到第一个页面

[英]How to open link in new page, then link back to the 1st page from the 2nd

I've been asked to implement a web page which opens a new browser window when you click a link (Page 1). 我被要求实现一个网页,当您单击链接(第1页)时,该页面会打开一个新的浏览器窗口。 The new page (Page 2) will have a link which when clicked will open a new url in Page 1. This needs to work in IE 6, 8 and other current browsers ideally. 新页面(页面2)将具有一个链接,单击该链接将在页面1中打开新的URL。理想情况下,它需要在IE 6、8和其他当前浏览器中正常工作。

Is this possible? 这可能吗? If so, how? 如果是这样,怎么办?

To open the window: 要打开窗口:

window.open ("http://www.someurl.com/maypage","my window");

To change the url from the popup: 要从弹出窗口更改网址:

self.opener.location = "http://www.someurlcom/anotherpage";
//Link in page 1
<a href="" onclick="window.open('someurl','page2'); return false;">open new window</a>

//Link in page 2
<a href="" onclick="opener.location.href='someurl'; return false;">show page in old window</a>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 单击第一页的链接后如何更改第二页div的背景颜色 - How to change the background color of a div on 2nd page once the link from 1st page is clicked 链接仅在第一次点击时有效,而从第二次点击开始将不会重定向到href中指定的页面 - link will work only on 1st click and from 2nd click will not redirect to the page which is specified in href 如何将所选日期选择器值从第一页显示到第二页日期选择器 - How to display the selected datepicker value from the 1st page onto the 2nd page datepicker 单击第一页的锚点时如何替换第二页中的图像? 在 JavaScript - How to replace images in 2nd page when an anchor from 1st page was clicked ? in JavaScript 如何将第二脚本标签包含/添加/链接到第一脚本标签中? - How to include/add/link 2nd script tag into 1st script tag? 当我单击浏览器中第一页中的按钮时,如何重新加载第二页? - How to reload 2nd page when i click the button in 1st page in browser? 我第一页的照片没有传递到第二页 - My photo from my 1st page is not passing down to my 2nd one 浏览器希望用户在按第二页上的后退按钮时重新提交/刷新第一页 - Browser wants the user to re-submit / refresh 1st page when pressing the back button on 2nd page 如何在页面初始加载时基于第一列表框动态填充第二列表框? - How do dynamically fill 2nd listbox based on 1st listbox on initial load of page? Datatable Javascript Link在第二页上不起作用 - Datatable Javascript Link not working on 2nd page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM