js method for button->new_window