Skip to main content
added 88 characters in body
Source Link
Ashwani
  • 22.7k
  • 4
  • 41
  • 73

Try this structure and make sure that tag <script> is not part of apex form:

  <apex:form>
     <!-- other stuff -->
     <apex:actionFunction name="doCallout" action="{!callout}" rerender="none"/>
    
    <!-- other stuff -->    
  </apex:form>
    <script>
    window.onload=function()
    {
        doCallout();
    }
    </script>

Note: I am assuming that you don't want to use action attribute of <apex:page>

Try this structure and make sure that tag <script> is not part of apex form:

  <apex:form>
     <!-- other stuff -->
     <apex:actionFunction name="doCallout" action="{!callout}" rerender="none"/>
    
    <!-- other stuff -->    
  </apex:form>
    <script>
    window.onload=function()
    {
        doCallout();
    }
    </script>

Try this structure and make sure that tag <script> is not part of apex form:

  <apex:form>
     <!-- other stuff -->
     <apex:actionFunction name="doCallout" action="{!callout}" rerender="none"/>
    
    <!-- other stuff -->    
  </apex:form>
    <script>
    window.onload=function()
    {
        doCallout();
    }
    </script>

Note: I am assuming that you don't want to use action attribute of <apex:page>

Source Link
Ashwani
  • 22.7k
  • 4
  • 41
  • 73

Try this structure and make sure that tag <script> is not part of apex form:

  <apex:form>
     <!-- other stuff -->
     <apex:actionFunction name="doCallout" action="{!callout}" rerender="none"/>
    
    <!-- other stuff -->    
  </apex:form>
    <script>
    window.onload=function()
    {
        doCallout();
    }
    </script>