开发者

javascript popup window help

开发者 https://www.devze.com 2023-02-22 10:18 出处:网络
This is what I want to accomplish..I created a pop up window from my original document. this is the code..

This is what I want to accomplish..I created a pop up window from my original document. this is the code..

<script type="text/javascript">
        function subscribe() {
            window.open("cover.htm", "popWin", "width=125, height=240, left=10, screenX=10, top=10, screenY=10");
        }
   </script>

I called the function when the window loads. Now in the the pop up I want to click on a link that will open another htm file in the original window. I know i have to use the opener keyword but don't know how to go about开发者_JS百科 doing this.

any suggestion will be greatly appreciated..


This seems to be a great article for what you are looking to do.


You can set a function on the parent page to change the location, then use the window.opener to access it.

Parent Page

function changeParentURL(url) {
    document.location=url;
}

Child Page

window.opener.changeParentURL('http://new.htm');
0

精彩评论

暂无评论...
验证码 换一张
取 消