javascript - window.close() not working when button is pressed but works when added to console(developer tools) -
i have simple script activated when button on window opened script clicked (meaning, page in current code exists opened window.open in page):
var botoncerrar = document.getelementbyid('cerrar'); botoncerrar.addeventlistener('click', function(){ open(location, '_self').close(); }, false);
the thing is, not work, "refreshes" window.
but when add command in console inside developer tools:
open(location, '_self').close();
it works. idea why?
Comments
Post a Comment