Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have a parent window under http and it opens a child popup window under https. I wanted to reload the parent from pop-up window using following Java Script.

<script language="JavaScript">
   function refreshParent() {
        window.opener.location.reload();
        window.close();
    }

I found that this is not possible due to cross-domain scripting restrictions and HTTP->HTTPS is considered cross domain.

After searching in internet, i found the workaround for cross domain problem using following script,

<script language="JavaScript">
    function refreshParent() {
        window.opener.location.href = 'index.html';
        windoww.close()
    }

Above solution works well with Chrome. But in IE, instead of reload the url in the parent window, it opens in an new tab. I dont want it to open in new tab.

Please help me on this. Any alternative suggestions to achieving this would also be appreciated.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Use the method window.open('mypage.html','_self'); Second parameter will open the page in the same tab. Should work fine in IE also, For further information refer http://www.javascript-coder.com/window-popup/javascript-window-open.phtml

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.