Add async in enqueue
-
A client wants me to add this external script to the footer:
<script src="//www.apex.live/scripts/invitation.ashx?company=regalrestorationservices" async></script>
I just pasted it to the footer of the site, but I wanted to add it to the footer the right way. I thought about adding this to the functions.php file:
function regal_chat_script() { wp_enqueue_script( 'chat-scrip', "//www.apex.live/scripts/invitation.ashx?company=regalrestorationservices", array(), '1.0', true); add_action( 'wp_enqueue_scripts', 'real_chat_script' ); }
But doing this would leave out the async attribute. How can I add the aync attribute?
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Add async in enqueue’ is closed to new replies.