PHP &

后端 未结 10 1799
误落风尘
误落风尘 2021-01-20 13:40

Is this correct? If not what is the correct syntax

I am new to php hence trying to learn.

    

        
10条回答
  •  隐瞒了意图╮
    2021-01-20 14:08

    I think that you can do that in your script , in a index.php script , write down this code :

    true"; 
    
      //then you can do echo $JSEnabled to see the result yourself 
    
      //in a condition statement ...
      if($JSEnabled) {
    
              // ... code for JS Enabled 
    
      } else {
    
              // ... code not JS Disabled 
    
      }
    

    UPDATE :

       $js = null;
       $js = (boolean) '';  
       //the noscript text : false is shown when no js support detected in your browser. this value will be converted to a boolean value for testing purpose.
    
       if($js) {                                      
       //if $js gets the no script text , that means that the browser is not supporting the js, so this line will check if $js is set to false , the else statement is fired , otherwise the if statement is fired
        echo 'Your javascript is enabled
    '; } else { echo 'Your javascript is disabled
    '; }

提交回复
热议问题