The PHP page executes `echo ("< script > window.open ('xxx'); < / script >"); `has no effect?

I have a test.php code:

<?php
echo ("<script>window.open("http://www.baidu.com");</script>");

when I execute it, why not open the Baidu page?
but if you make a button click event to open it, then you can succeed.

Php
Apr.28,2021

Direct open will be blocked by the browser. Location can jump

echo ("<script>window.location = 'http://www.baidu.com';</script>");
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf9b5d-321b6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf9b5d-321b6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?