Support

Account

Home Forums General Issues How do you enable the Javascript API? Reply To: How do you enable the Javascript API?

  • There could be several things going on.

    The first is that the ACF scripts are not included. You should enqueue your scripts on the acf/input/admin_enqueue_scripts hook. You should also use array('acf-input') as the script that your script depends on to make sure that acf is loaded first.

    The second thing that could be happening is that you’re trying to run your script too early. You should not try to interact with ACF until after the document is ready.

    
    jQuery(document).ready(function($) {
      // your code goes here
    });