CMS Development

LTDev
Member

How can I add defer and asynchronous for JavaScript & CSS file

SOLVE

I'm not able to find a way to add defer and asynchronous for JavaScript & CSS files. Also, how can I find the base template or theme name which one use on our pages?

0 Upvotes
2 Accepted solutions
jonchim
Solution
Guide | Diamond Partner
Guide | Diamond Partner

How can I add defer and asynchronous for JavaScript & CSS file

SOLVE

Hey @LTDev,

I believe you should be able to define that manually in your base.html file (usually found under theme name > templates > layoutt) if you're using themes or under hubspot settings in website > pages.






Jon Chim
VP of Design & Development
Hypha HubSpot Development


check Did my post help answer your query? Help the Community by marking it as a solution

View solution in original post

BarryGrennan
Solution
Top Contributor

How can I add defer and asynchronous for JavaScript & CSS file

SOLVE

You'd use the require_js tag and add your defer/async settings to there.

 

You'll find the template you're using for an individual page on it's edit screen, click Setting>Advanced Settings>Template (I'm 90% certain that's right, I'm going from memory on my phone 😂 It's definitely under settings anyway)

 


profile2022aBarry Grennan

Freelance HubSpot CMS Developer

Website | Contact | LinkedIn

 

 

View solution in original post

2 Replies 2
BarryGrennan
Solution
Top Contributor

How can I add defer and asynchronous for JavaScript & CSS file

SOLVE

You'd use the require_js tag and add your defer/async settings to there.

 

You'll find the template you're using for an individual page on it's edit screen, click Setting>Advanced Settings>Template (I'm 90% certain that's right, I'm going from memory on my phone 😂 It's definitely under settings anyway)

 


profile2022aBarry Grennan

Freelance HubSpot CMS Developer

Website | Contact | LinkedIn

 

 

jonchim
Solution
Guide | Diamond Partner
Guide | Diamond Partner

How can I add defer and asynchronous for JavaScript & CSS file

SOLVE

Hey @LTDev,

I believe you should be able to define that manually in your base.html file (usually found under theme name > templates > layoutt) if you're using themes or under hubspot settings in website > pages.






Jon Chim
VP of Design & Development
Hypha HubSpot Development


check Did my post help answer your query? Help the Community by marking it as a solution