javascript - popup gets closed automatically -


i have refresh parent window once done changes in popup window, use :

 <body onunload="opener.location.reload();">   

but closes window on event, save, whereas don't want close. want close window clicking window close or clicking close button in jsp "javascript".

for closing thru "close" button.

js :

function closeandrefresh(){     opener.location.reload(true);     window.close();  } 

enter image description here

solved problem

js:

var myclose = false;    function confirmclose()  {      if (event.clienty < 0)      {         myclose=true;      }  }    function handleonclose()  {      if (myclose==true)       {      	opener.location.href = "<%=request.getcontextpath()%>parent_jsp_path";          window.close();      }     }

html:

<body onbeforeunload="confirmclose();" onunload="handleonclose();"> 

Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -