I've got some tracking code that I have to embed in the footer of my page. The tracking code is from a 3rd party company and uses document.write which of course is blocking. I've sent a support request to the company and they don't seem to have any interest in changing the code.
The tracking code looks something like this:
document.write (
'<img src="http://company-url.com/visitor.gif?ts='+
new Date().getTime()+
'&ref='+escape(document.referrer) + '">'
);
So, my question is, is it possible to make document.write non blocking?
document.getElementById('footer').innerHTML = '<img ... />'?document.writeat all if I had the choice!document.writethat's blocking, but rather all script execution is blocking, unless you use stuff likedeferorasync. But thendocument.writedoesn't work any longer.src? If the latter, there's not much you can do, but if it's inline so you can change it, @bfavaretto's solution would work.