Saturday 18 April 2015

We all know that SharePoint is compatible with IE, some features will not work as expect in all browsers(chrome/Mozilla). I had a requirement from my client that they want to refresh parent page if they close the parent window(Which is working fine in IE  but not in chrome/Mozilla).since they want it in those browsers also i had a work around and finally i achieved it.

<script language ="JavaScript">
       // To refresh in IE
window.onunload = function(e){

     window.opener.document.location.href = 'parent page URL';  
  };
        //To refresh chrome
window.top.onunload = function (e) {
 
    window.opener.document.location.href = 'parent page URL';
};

//To refresh mozilla
$(window).bind('beforeunload', function(){

window.opener.document.location.href = 'parent page URL';
});

0 comments:

Post a Comment