2009-01-21

How to close window without prompt. JavaScript.

For most of browsers work code like this:


window.opener = top;
window.close();


But for IE7 will work this code:

<script language=javascript>
function CloseWindow()
{
window.open('','_self','');
window.close();
}
</script>

<input type=button name="closebutton" value="Close" class="Button" onclick="CloseWindow()"/>

Комментариев нет: