D
Derek
Hello:
Can anybody tell me how to detect browser close event in Javascript and how
to call a servlet on a Brower close?
I tried some thing:
<html>
<SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
function unloadMess(){
mess = "message."
return mess;
}
function setBunload(on){
window.onbeforeunload = (on) ? unloadMess : null;
location.href="http://localhost/servlet/ServletPrueba";
}
setBunload(true);
</SCRIPT>
<BODY>
<a href="http://www.microsoft.com" onClick="setBunload(true)">Link 1</a>
<br>
<a href="http://localhost:8080/Version3/pagina2.html"
onClick="setBunload(false)">Link 2l</a>
</BODY>
</html>
But, I want call the servlet only when close browser or I browse to another
web.
Thanks.
Can anybody tell me how to detect browser close event in Javascript and how
to call a servlet on a Brower close?
I tried some thing:
<html>
<SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
function unloadMess(){
mess = "message."
return mess;
}
function setBunload(on){
window.onbeforeunload = (on) ? unloadMess : null;
location.href="http://localhost/servlet/ServletPrueba";
}
setBunload(true);
</SCRIPT>
<BODY>
<a href="http://www.microsoft.com" onClick="setBunload(true)">Link 1</a>
<br>
<a href="http://localhost:8080/Version3/pagina2.html"
onClick="setBunload(false)">Link 2l</a>
</BODY>
</html>
But, I want call the servlet only when close browser or I browse to another
web.
Thanks.