I'm implementing Dialog for Jquery UI in my application. When the dialog is closed it should close the current window using the window.open();
method of javascript.
However this does not occur, and the following error is still displayed in the console:
Scripts may close only the windows that were opened by it.
For some time I've been looking for the solution on Google, but everything I've found has not been enough. An example of a massively accepted solution that did not solve my problem was the use of the following code (or similar variations):
window.open('', '_self', '');
window.close();
I've simplified my application code to use example in this fiddle , although with JSFiddle the message for error, and neither window is closed.