I have an external JavaScript src which I want to add a loading animation until it's finish loading:
<script src="https://xxxx.domain.com/xxx.js" type="text/javascript"></script>
I'm currently using jQuery (window).load, but its waiting until all page is fully loaded, I want to wait only for that specific code:
<script>$(window).load(function(){$(".loadingif").hide();});</script>
Update: This is my code as you have suggested, it's is not working, what I'm doing wrong---
some text.....
<span class="loading-gif"></span>
<script src="https://xxxx.domain.com/xxx.js" type="text/javascript"></script>
<script>hideLoading();</script>
some text.....
<script>function hideLoading(){$(".loading-gif").hide();}</script>