Including php in the <noscript> tag

Is it possible to include a php file in a tag <noscript>? ...... to show if javascript is disabled?

+3
source share
3 answers

It is not possible for your server side PHP code to detect if Javascript is disabled.

If you put the PHP code inside the tag <noscript>, it will always execute, regardless of whether Javascript is enabled or not. However, the output of the code will only be displayed if Javascript is disabled.

You might want to use Javascript to redirect to a separate page.

+5
source

The easiest way to include a PHP file if JavaScript was not included is likely to be this:

<noscript><iframe src="your_php_file.php"></iframe></noscript>

( , , )

+9

. , PHP. PHP , - .

-

- PHP
- , , PHP-. PHP- .


HTML Javascript, -

PHP , Javascript.

+6

Source: https://habr.com/ru/post/1727050/


All Articles