Now there\'s quite a lot of similar-looking questions here, but I was wondering, what should I do, if I want not to just change the location of the window, but
location
Yes, very simple:
$('#YourSelector').click();
this will emulate a user click.