This question already has an answer here:
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;
}
</div>
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>
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