Salesforce 如何在地址栏中隐藏Url?

Salesforce 如何在地址栏中隐藏Url?,salesforce,Salesforce,我想在地址栏中隐藏URL。有人能帮我吗?我已经写了代码,但它正在打开一个新窗口,我想隐藏这个url 我的代码是 <apex:page controller="HiddenAddressBarController" sidebar="false" > <apex:pagemessages /> <apex:form id="frm"> <apex:pageblock title="Login Form" i

我想在地址栏中隐藏URL。有人能帮我吗?我已经写了代码,但它正在打开一个新窗口,我想隐藏这个url

我的代码是

 <apex:page controller="HiddenAddressBarController" sidebar="false" >
    <apex:pagemessages />
        <apex:form id="frm">
            <apex:pageblock title="Login Form" id="pgblck">
                <apex:pageblockSection id="pgblcksec">
                     <apex:outputLabel value="User Name : ">
                        <apex:inputtext value="{!UserName}" id="Usrn"/>
                    </apex:outputLabel>
                    <apex:outputLabel value="Password : ">
                        <apex:inputSecret value="{!Password}" id="Pwd"/>
                    </apex:outputLabel>
                </apex:pageblockSection>

                <apex:pageblockbuttons >
                     <!-- <apex:commandButton value="Login" action="{!loginMethod}"/> -->
                     <apex:commandButton value="Login" onclick="ValidateadnRedirect(); return false; "/> 
                    <!-- <apex:actionFunction name="ValidateandRedirect" action="{!loginMethod}"/>  -->
                </apex:pageblockbuttons>

            </apex:pageblock>
              <script type="text/javascript">
                function ValidateadnRedirect()
                {
                    <!-- alert('----'+document.getElementById("{!$Component.frm.pgblck.pgblcksec.Usrn}").value); -->
                    if(document.getElementById("{!$Component.frm.pgblck.pgblcksec.Usrn}").value=='')
                    {
                        alert('Please fill User Name');
                       // return false;
                    }
                    if(document.getElementById("{!$Component.frm.pgblck.pgblcksec.Pwd}").value=='')
                    {
                        alert('Please fill Password');
                        // return false;
                    }


                else
                {
                    window.open("https://www.google.com");
                }
        </script> 
    </apex:form>
  </apex:page>

将历史API与javascript一起使用

一个好的教程是

您已经在使用javascript,因此只需进行以下调用:

history.pushStatenull,null,urluwant