Jump to content


window.close is not working in firefox and mozilla browsers


4 replies to this topic

#1 shashi_bi

    Member

  • Members
  • PipPip
  • 25 posts

Posted 15 July 2005 - 11:50 AM

Hi

In my application i have two button ok and cancel after clicking the cancel button the window should close automatically.This window is a parent window(not generated by the script).Here i used window.close(). It is working in IE but it is not working in Netscape,Firefox and Mozilla.

#2 phpprogrammer

    Advanced Member

  • Members
  • PipPipPip
  • 453 posts

Posted 15 July 2005 - 02:04 PM

hi,
use self.close();

regards
bvsureshbabu

#3 Guest_shashi_*

  • Guests

Posted 16 July 2005 - 04:42 AM

Hi

I have checked with the self.close() also it is not working.Firefox is generating the error "Scripts may not close windows that were not opened by script."

Thanx
Shashi Kumar Bhandar

#4 alMubarmij

    Newbie

  • Members
  • Pip
  • 0 posts

Posted 22 April 2006 - 06:53 AM

You must close window which you opened it by: window.open(); only.

#5 starshant

    Newbie

  • Members
  • Pip
  • 0 posts

Posted 23 December 2009 - 10:58 AM

simplest way is to use this.close() in javascript.

eg.,

<div>
<script type="text/javascript">
function closed()
{
this.close();
}
</script>
<input type="button" value="close" onclick="javascript:closed();" />
</div>





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users