Home › Forums › Feature Requests › Access country from a Google Maps geocoding request › Reply To: Access country from a Google Maps geocoding request
Hi @wloske
I believe you need to execute it only when the page is loaded like this:
<script type="text/javascript">
(function($) {
// execute the code when the page is loaded
$(document).ready(function(){
// Your code here
});
})(jQuery);
</script>
Sometimes, you also need to watch the newly created element by using the on()
function. This page should give you more idea about it: http://stackoverflow.com/questions/6658752/click-event-doesnt-work-on-dynamically-generated-elements.
Hope this helps 🙂
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.