PDA

View Full Version : close window on clicking javascript confirmation window



tinyjacob
02-09-2010, 05:03 AM
I have a radio button rd1 .On clicking i call function confirmCancel{
if(confirm("Do you want to cancel the order")){

var link="CancelOrder.jsp";
var target = "self";
var properties = "toolbar=no, location=no, directories=no, status=no,menubar=no, scrollbars=no, resizable=no, left=360px,top=340px, copyhistory=no, width=100px, height=10px";
window.open(link, null, properties);
return true;
}else{
return false;
}
}

When CancelOrder.jsp is loaded ,a bean function is invoked in the constructor.When CancelOrder.jsp opens i ve written onload="showAlert()" in CancelOrder.jsp.

<script>
function showAlert(){
window.resizeTo(0,0);
alert("Order cancellation successfull");
window.close();
}
</script>

I wrote this window.resizeTo(0,0) ; window.close(); inorder to hide the opened CancelOrder.jsp simultaenously when the alert window is displayed.But i want to hide the window as such...I must be able to invoke the function in CancelOrder.jsp but it shouldnt get popped open...