sylvain1870 Posted December 8, 2021 Share Posted December 8, 2021 Hello guys, It seems i can't fin any solution yet but my Gsap runs 1/4 of the time. I tried using with CDN and Zip but both return the same error 1/4 of the time if reload the page. CodeJS.js:1 Uncaught ReferenceError: gsap is not defined Right now i am trying with the files.js , i ve put the <script> in the <head> with async and defer. I also have : gsap.registerPlugin(ScrollTrigger); in first of my js code. Can anyone help me please? i'm willing to learn Gsap but there it bringing me crasy as i cannot even get stared Thank you so much in advance. Link to comment Share on other sites More sharing options...
OSUblake Posted December 8, 2021 Share Posted December 8, 2021 You should always put your files before the closing </body> tag. When you put your files in the head, the DOM won't be ready, and you don't need async or defer. <html> <body> <h1>Hello</h1> <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.8.0/gsap.min.js"></script> <script src="myFiles.js"></script> </body> </html> 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now