More than one year ago I was play­ing with AJAX, and I was facing a prob­lem with scripts con­tained in doc­u­ments loaded through XML­HttpRe­quest. So, at that time, I wrote two blog posts talk­ing about this issue. The first was just a modify to the well known AHAH tech­nique, while the second post was a script I entirely wrote by myself: “Javascript script exe­cu­tion in inner­HTML: the revenge”.

Now more than a year has passed and tech­nolo­gies are evolved. Now the web is full of very pow­er­ful AJAX frame­works and much prob­a­bly, for medium/big projects you won’t need this kind of “hack” any­more. But there are few devel­op­ers across the world that still hand-​code their little ajax tricks and needs this. So, since I received a lot of com­ments about that, I’m writ­ing here again to update you about the mod­i­fies that have been done to that script.

That script suf­fered of a (rel­a­tively) big prob­lem: if you had a document.write() call in the exter­nal script you loaded, well, it won’t work. Jeremy Bell has mod­i­fied that script in order to have this func­tion­al­ity included. You can see it work­ing at http://​www.​black​outweb​de​sign.​com/​a​j​a​x​.​d​e​m​o.php.

For other dis­cus­sion about the topic, look at the com­ments in the post, they have been very help­ful to me to cor­rect var­i­ous com­pat­i­bil­ity issues.