function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ArjunmcaArjunmca 

App name in visualforce

Hi,

I have to change my visualforce code based on the app. If there a way to write if function without using any apex command?
Is there a better way to write the logic?

The below line gives app name.
   var myappname = document.getElementById("tsidLabel").innerText;

<apex:page>
<script>
    function getAppName(){
        var myappname = document.getElementById("tsidLabel").innerText;
    }
  </script>

  if(myappname =='Student")
    <apex:commandbutton id="test" value="Test"/>
 elseif(myappname =="Employee")
    <apex:Label id="lbl" value="Label">
else
    <apex:inputfield id="input" value="Input">


</apex:page>