Scripts & stylesheets aren't loaded when a form is rendered via AJAX

Created by Phil Kurth, Modified on Tue, 28 Jun 2022 at 03:07 PM by Phil Kurth

Enqueueing of scripts and styles happens when a form is rendered which will be problematic when rendering a form via AJAX. In such a scenario, it is necessary to call the af_enqueue() PHP function as the request renders. 


You could call this from within a callback hooked to the wp_enqueue_scripts hook or from within a template.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article