How to call the external script on scroll only? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to call the external script on scroll only?

I don't want to load js script until user scroll or mouseover. How is that possible? For example https://google.com/my.js I want to load that script only on scroll to improve performance.

25th Nov 2019, 3:50 AM
Uzair Malim
Uzair Malim - avatar
1 Answer
+ 2
put the importing script tag just before </body>
25th Nov 2019, 4:33 AM
Gordon
Gordon - avatar