简体   繁体   中英

Move script from body to head

I'm running into an issue with WordPress and form embeds. I have a page built via WP Bakery and one of the block allows a user to embed a form onto the page.

This however is causing the form to load in slow (sometimes takes up to three seconds for the form to load in).

As a solution to this, I'm trying to get the <script> tags to render in the head rather than in the body .

Is this even possible? The script needs to move into the head before page load so that the form renders in - but unsure if this is even feasible?

您可以附加async加载脚本异步。

<script async src="..."></script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM