I am trying to implement a code in which when user clicks on Logout link then a warning message has to be dispalyed to the user which is
This will terminate the session and close the browser. Do you want to continue?
My website is running on IE6 and IE7. I have written below piece of code to implment it.
Sub OnClickLogout()
dim Answer, msg
Msg = "This will terminate the session and close the browser. Do you want to continue?"
Answer = MsgBox(Msg, vbYesNo + vbExclamation, "Warning")
if Answer = vbYes then
window.opener = "y"
window.parent.opener= "x"
window.parent.close
end if
End Sub
My code is working perfectly fine in IE6 and my window is closing properly.
But in IE7 when I click on Yes button then I am getting an extra message as follows:
“The web page you are viewing is trying to close the window. Do you want to close this window?” with Yes and NO button
I dont want this extra message. I was getting the same message in IE6 also but for that I searched and checked that you have to set the window.parent.opener = "Some String". But this is not working in IE7 Could you all suggest me how to remove this message in IE7
You can try this to avoid the Microsoft message in IE7:-
I am sure it will definitely work.