Jhopper wrote:Hello,
I'm working on getting my mobile page speed down and a few of the plugins I use are blocking the page from loading.
Is there a way add an async attribute to the script tag or to have them called before the closing body tag instead of calling them in head?
Thank you :)
Hi Jhopper,
All of the public views are open for modifications, so you can change where the scripts will be rendered.
For example, if you have this code:
Html.AddScriptParts("~/Plugins/SevenSpikes.Core/Scripts/SevenSpikesExtensions.js");
you can make it like this:
Html.AddScriptParts(ResourceLocation.Foot, "~/Plugins/SevenSpikes.Core/Scripts/SevenSpikesExtensions.js");
This way the javascript file will be called before the closing body tag. But to be honest I'm not sure that everything will work as expected if you change this.
Hope this helps!