Php and js cannot be combined. One is on the server and the other is on the front desk. For the sake of security, some "operations" should not continue running if the user's front-end js is not executed. & Amp; lt; noscript & amp; gt; can only change the appearance style. It has no effect... php and js cannot be combined. One is on the server and the other is on the front desk.
For the sake of security, some "operations" should not continue running if the user's front-end js is not executed.
It can only change the appearance style, but it does not have any effect. Besides, it can be changed back at the front end.
Therefore, is there a way for the php program to know whether the user's browser has successfully run js?
Reply content:
Php and js cannot be combined. One is on the server and the other is on the front desk.
For the sake of security, some "operations" should not continue running if the user's front-end js is not executed.
It can only change the appearance style, but it does not have any effect. Besides, it can be changed back at the front end.
Therefore, is there a way for the php program to know whether the user's browser has successfully run js?
Add a hidden iframe to open a detection page. Add a meta to this page and refresh it to the notification page after a certain period of time (such as 5 seconds. Then a script is followed to redirect the current page to another page. If the Browser allows JavaScript code execution, it will jump to the 2nd pages without sending a notification.
《script》 window.location.href="/has-scripts.php"; 《script》
Does js initiate an asynchronous request to the server?
Send an asynchronous request to the backend.