---
schema_version: "1"
id: b242841ade7ef4285d071125cfde20f70b76cf01932fddf097d13531163a4aad
title: Comparing JavaScript Remoting and <apex:actionFunction>
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/salesforce-pages-developers-guide/guides/pages/javascript/pages-js-remoting-compare-actionfunction.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-js-remoting-compare-actionfunction.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 57b516470c3770e908ced224afc9a8b82224260ffe56312907cee1dc1b797582
products:
  - Visualforce Developer Guide
  - Platform Developer Content
---

# Comparing JavaScript Remoting and \<apex:actionFunction>

The `<apex:actionFunction>` component also lets you call controller action methods through JavaScript.

In general, `<apex:actionFunction>` is easier to use and requires less code, while JavaScript remoting offers more flexibility.

Here are some specific differences between the two.

-   The `<apex:actionFunction>` tag:

    -   lets you specify rerender targets
    -   submits the form
    -   doesn’t require you to write any JavaScript
-   JavaScript remoting:

    -   lets you pass parameters
    -   provides a callback
    -   requires you to write some JavaScript

