I created a JSP page that opens a dialog using jQuery.
JSP (div):
<div id="dialog" title="Welcome To Chat" class="ui-helper-hidden tabdialog">
<iframe id="inlineframe" name="inlineframe" src="" frameborder="0" scrolling="auto" width="600" height="600" marginwidth="5" marginheight="5" ></iframe>
</div>
jQuery:
$("#inlineframe").attr("src","chat.jsp?roomid=" + id[1]);
$( "#dialog" ).dialog({
width:626,
height:626,
beforeClose:function(){
alert("closing");
}
});
So far, so good. Notice I am only using an alert on the beforeClose
function for now. The iframe itself is opening a JSP page named chat.jsp
which has a multitude of jQuery functions in it also as it is the front end of a chat program.
Question:
How do I send a message to the
chat.jsp
page so that it knows the dialog box is being closed?"
This is important as chat.jsp
needs to communicate back to the server that the user has logged out of chat. That process will likely take about a second, so I'll need to delay the closing of the dialog for at least that long.
What is my best option for communicating the closing event to chat.jsp
and affording it enough time to execute a proper close?