lee_youjin@hotmail.com wrote:
Quote:
I needed to defect when the user is clicking the IE X button ( top
right). so I could execute the cleanup function.
>
I was able to detect it using onbeforeunload event. Now I need to call
the function in code behind from onbeforeunload event call.
>
but that is where I have a problem...
>
please refer my code below
>
my body tag - <body onbeforeunload = "X_close()">
>
Javascript - function X_close( ) { if ( window.event.clientX < 0 ||
window.event.clientY < 0) { alert("test") } }
>
Is there a way I can call Cleanup func from X_close func? or is there
some other way to do this.. Any help appreciated!!!!!!! Thanks!!!
[snip]
Yes it's possible. Of course you would also know that vbscript would
only work on IE. But anyways, the following example shows that it
works:
<html>
<head>
<title>example</title>
</head>
<body>
<script type = "text/vbscript">
function vbFunc()
document.write("vbscript")
end function
</script>
<script type = "text/javascript">
function jsFunc()
{
document.write("javascript");
}
vbFunc();
</script>
</body>
</html>
Please make note of the order that they're in. The vbscript must come
first before you are able to call the function. Tested in IE6.