January 2007 - Posts

Close Window Without Warning Message - Javascript

If you have ever tried to close a window and receive this warning "The page is trying to close the window", this warning message shows up everytime we use window.close(). to solve this issue we have to look at how window.close() works

window.close() looks to the opener window, if it's equal to empty string it displays this kind of message, so to bypass this all you need to is to set the opener to a string and then use the close() function

<script language="javascript">

function CloseWindow()

{

window.opener = 'as'; // Or window.opener = self;

window.close()

}

</script>

 

Just Passed The 70-315 Exam

Today i passed the Asp.net Exam with a score 981/1000. it feels good when you feel your approaching to the goal you have previously set.

and now i'm finally free to start writing articles.

Happy .Net Coding

Rich text Editor

Learn How to create a text editor to be used inside your web application for your forums, blogs, chat, etc...

http://aspalliance.com/1092

 Best Regards

This site

Search

Go

This Blog

Syndication

Sponsors

  • MaximumASP
  • Packet Sniffer