<script type="text/javascript">
$(function () { var count = 0; window.onfocus = function (event) { } window.onblur = function (event) { increase(count); if (count == 2) { alert("Switching between views is not allowed"); } else if (count == 3) { alert("This window will be closed as you made maximum attempts"); var win = window.open(("about:blank", "_self"); //win.close(); } } function increase() { count++; return false; } });
</script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)