I am have issue closing a popup window:
VF:
<apex:commandButton value="Close" onclick="CloseAndRefresh();return:true;" id="btn"/>
<script language="JavaScript" type="text/javascript">
function CloseAndRefresh(){
window.opener.location.href="/{!$CurrentPage.parameters.id}";
window.top.close();
}
</script>
Also Popup i am calling frm Javascript button. ie:
var j$ = jQuery.noConflict();
var recID = '{!User.Id}';
var iframe_url = '{!URLFOR("/apex/mypage?Id=")}';
var child_domain = iframe_url.substring(0, iframe_url.indexOf('/', 9));
var parent_domain = window.location.protocol + '//' + window.location.host;
var j$modalDialog = j$('<div id="opppopup"></div>')
.html('<iframe id="iframeContentId" src="' + iframe_url +recID + '" frameborder="0" height="100%" width="100%" marginheight="0" marginwidth="0" scrolling="yes" />')
.dialog({
autoOpen: false,
title: 'popUp',
resizable: true,
width: 1050,
height: 190,
autoResize: true,
modal: true,
draggable: true
});
j$modalDialog.dialog('open');
Can you please guide me for above problem.