self.close();

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

self.close();

Post by shiznatix »

I am opening a popup window with window.open() but I am trying to close the popup window with self.close after I submit a forum but for whatever god aweful reason it is not working.

I get this error:
Error: [Exception... "'JavaScript component does not have a method named: "isTabContentWindow"' when calling method: [nsIBrowserDOMWindow::isTabContentWindow]" nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)" location: "<unknown>" data: no]
I was looking this up but the only answer i got was to disable noscript, which I did, but that did nothing.

I am running firefox 2.0.0.4 on Vista
User avatar
Gente
Forum Contributor
Posts: 252
Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:

Post by Gente »

Maybe this will help

Code: Select all

  window.opener = self;
  window.close();
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

Gente wrote:Maybe this will help

Code: Select all

  window.opener = self;
  window.close();
Sounded good but it did not work, same error. This is the strangest thing.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

window.close() didn't work?

Try dropping the window?

How and where are you calling window.close() inside a button's onclick or some external javascript?
Post Reply