Get All Objects in Salesforce Org

We can use Schema.getGlobalDescribe() to get all properties of sObject.
Apex Class:

public class SampleController {
    
    Public string selectedObj{get;set;}
    
    Public List<Selectoption> getObjList(){
        List<Schema.SObjectType> objList = Schema.getGlobalDescribe().Values();     
        List<SelectOption> objNames = new List<SelectOption>();
        objNames.add(new SelectOption('','-- Select --'));
        for(Schema.SObjectType obj : objList)
        {
            objNames.add(new SelectOption(obj.getDescribe().getName(),obj.getDescribe().getLabel()));
        }
        objNames.sort();
        return objNames;
    }
}

Visualforce Page:

<apex:page controller="SampleController">
    <apex:form >
        <apex:pageBlock>
            <apex:outputlabel value="Object Name" for="plObj"/>      
            <apex:selectList value="{!selectedObj}" multiselect="false" id="plObj" size="1">
                <apex:selectOptions value="{!ObjList}"/>
            </apex:selectList>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Output:

Passing Variables from Apex to JavaScript

Sometimes we need to pass variables from apex to javascript. Here is an example to pass variables from apex to javascript. In below example I’m invoking one apex method using action function. In the apex method I’m defining the apex variable value. On complete of action function I’m invoking one javascript method and using the apex variable in the javascript method.

Visualforce Page:

<apex:page controller="SampleController">  
    <apex:form>
        <apex:outputPanel id="jspanel"> 
            <script>  
            function onCompleteMethod() {
                alert('{!message}')
            }
            </script>
        </apex:outputPanel>
        <apex:actionFunction name="afHelloWorld" action="{!HelloWorld}" rerender="jspanel"/>
        <apex:commandButton onclick="afHelloWorld();" oncomplete="onCompleteMethod()" value="Click me"/>
    </apex:form>
</apex:page>

Apex Class:

public class SampleController {
    
    public String message {get;set;}
    
    public pageReference HelloWorld() {
        message = 'Hello World!!';
        return null;
    }   
}

Display Standard Salesforce Help Text on Visualforce Page

<apex:page>
    <style>
        .vfHelpText a            {position:relative;}
        .vfHelpText a span       {display: none;}
        .vfHelpText a:hover span {display: block;
        position:absolute;
        top:1.25em;
        padding:2px 5px;
        left:-15em; width:15em;
        z-index:100;
        border:1px solid orange;
        background-color:#FEFDB9;
        color:black;
        }
        .helpOrb {
        background-image: url(/img/help/helpOrbs.gif);
        background-position: 0 0;
        width: 20px;
        height: 15px;
        }
        .helpButtonon .helpOrb {
        background-position: top right;
        }
        .helpButton .helpOrb {
        background-position: top left;
        }
    </style>
    
    <span class="vfHelpText">
        <apex:outputLink value="javascript:return false;">
            <img src="/s.gif" alt="" class="helpOrb" />
            <!--s.gif image is standard image no need to upload anywhere-->
            <span>{!$ObjectType.Contact.fields.AccountId.inlineHelpText}</span>
        </apex:outputLink>
    </span>
</apex:page>