0
Proper way to add CDN, I'm getting an error
I'm trying to add the CDN of Gsap into my project. I added a script at the botton inside of the <body> but there is an error with the first variable used. https://code.sololearn.com/W7jc0rLbK9cg/#html I was able to get font awsome to load, just not Gsap. I was able to upload the code to CodePen and my personal page, but having trouble here. Any ideas on what to check? Thanks for your time!
2 Answers
+ 1
Eric
Your code is trying to call the TweenMax object before the Gsap library is loaded, you can use the event DOMContentLoaded as you have done in your other projects here on sololearn namely "Score Cunter Webpage".
+ 1
Hmmm its quit simple add your javascript code inside window.onload = function(){
Your js code
}
And second thing add your js CDN in head instead of last of the body and I think there is not use of adding to head it's all right there also. but add your javascript code in window.onload .