I need to execute some scripts when all the resources on my domain and subdomain are loaded, so I did this:
$(window).load(function(){
// al my functions here...
}
The problem is that there are some external resources (not on my domain and subdomain) that sometimes take longer to load. Is there a way to exclude external resources from the load event?
EDIT:
I was hoping to do something like:
$(window).not(".idontcare").load(function()
but it’s not working
I guess your external resources rely on a
srcattribute.If so, in your page source code you could set the
srcattribute of the resources you don’t want to wait for, not assrcbut asexternal_src.Then you could easily do:
This way the external resources should start loading as soon as just the DOM is ready, without waiting for the full window load.