24 ways to impress your friends

Jump to menu

Vote down?

Shaun Inman

“Is it possible to check if the responseText is loaded, and if so, run the script?”

Yes, but that requires that the JavaScript you are going to run be known and already loaded by the containing page before making the request.

The point here is that the JavaScript loaded from the XMLHttpRequest along with the HTML fragment is arbitrary.