0

I am using Joomla latest version 2.5.14 and I want to apply some condition so I want to check is JavaScript is enable/disable.

Note: I want to check with server side side.

What I want:

if($sub_menu == "find" and $user->guest){
        if(){
            // if javascript is enable
        }else{
            // if javascript is disable 
        }               
    }else{
        echo $opentag . '<a class="maximenuck ' . $item->anchor_css . '" href="' . $item->flink . '"' . $title . $item->rel . '>' . $linktype . '</a>' . $closetag; 
    }
Rajnikanth
  • 2,745
  • 6
  • 31
  • 46

2 Answers2

0

You can remove if and else and put all your javascript with tag <noscript>

<script>
document.write("Hello World!")
</script>
<noscript>Your browser does not support JavaScript!</noscript>
Donovan Charpin
  • 3,567
  • 22
  • 30
0

Server-side you are not able to do that. Other thing is it does not matter you are using Joomla. You can use the conventional method. Try below

How to detect if JavaScript is disabled?

Check if JavaScript is enabled with PHP

Community
  • 1
  • 1
Techie
  • 44,706
  • 42
  • 157
  • 243