Javascript-is there a way for the php program to know whether the user's browser has successfully run javascript?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.