Some days ago, our ads engine was behaving the (very) wrong way.Randomly, all of our sites were taking a 1-2 minutes to load a page. It turned out some of our insertionist server was down, thus delaying request’s response for ages, and -afterwards- giving up.
It turned out our banner service provider was using document.write to render the banners on the page. How bad !
Copy pasting the evalueted-resulting in firefox I got a long script which purpose was to write into document the requested banner using document.write.
Because inline scripts force user’s browser to wait for the code to complete (even if we have to wait for an external url to load) before rendering the rest of page.
Because we can’t further process (modify/duplicate etc) the output before embedding it in the actual webpage.
Also they bloat the xhtml code (this is where Behaviours went from)
It took some hour to came up with my own solution (which I won’t explain, mainly cause is in the office’s PC so I don’t have at hand right now).
Anyway it feels good to see other people had the same problem and came up with handy solutions (warning: I didn’t test that code).