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
niven sf 1niven sf 1 

how to write action function to auto open the link in vf pages

Raj VakatiRaj Vakati
You no need to use Action function  .. try this .. 
 
<apex:page Controller="MailExtension" showheader="false" sidebar="false">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"/>

    
    <apex:form>
        
        <apex:outputpanel id="link">
            <apex:outputText value="{!MailExtension}" /> 
            <apex:actionSupport event="onclick" 
                                action="{!getMailExtension}" immediate="true" rendered="true"/>
            
            
        </apex:outputpanel> 
        
    </apex:form>
    
    <script>
    jQuery(document).ready(function() 
        {
          
           window.location.href = "{!getMailExtension}";

        }); 
</script>
    
</apex:page>

 
niven sf 1niven sf 1
Hello Raj Vakati, 

     Thanks for your reply. It is successfully working. I had added this visual force page to the homepage layout. but I got an error while loading page in homepage.error is
 "c.cs60.visual.force.com refused to connect"