Home › Forums › Front-end Issues › How to wait until content is loaded before running JS? › Reply To: How to wait until content is loaded before running JS?
I’m just pulling in content like images and text into the php page template. For example:
<li class="slide""> <img src="<?php the_sub_field('client_img'); ?>"> <div class="copy"> <p><?php the_sub_field('client_testimonial'); ?></p> <div class="author">- <span class="name"><?php the_sub_field('client_name'); ?></span>, <span class="title"><?php the_sub_field('client_title'); ?></span> </div> </div> </li>
That part is working fine. It’s just that at the time that my JS runs, it only sees the HTML and not the actual field values.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
The ACF site is currently experiencing some issues.— Advanced Custom Fields (@wp_acf) September 21, 2022
We apologize for the inconvenience and we are working hard to get it back up and running as soon as possible.
© 2022 Advanced Custom Fields.