I believe there are two issues at hand. The first one is easy to solve. element.innerHTML should always be avoided. Iirc, it has been deprecated, and it won't do the trick for you here.
However, if your ajax call got a json response which evaluates to an array corresponding to the nodes you need instead of one long string of html code, you could use appendChild and build the DOM tree yourself. I leave building the array structure server side and going through it properly client side to you. If you need a generic solution, it will take some time. Else, you can create the structure by hand of course.
Once that is in place
var d = document;
var div = d.getElementById('ajaxCall');
// somewhere when going through your data, this should happen
var rec = d.createElement('div');
rec.id = 'recaptcha';
var scr = d.createElement('script');
scr.type = 'text/javascript';
scr.src = 'http://api.recaptcha.net/challenge?k=6LfPJwgAAAAAAI-8F3Lp11umLntMpXov8Xfz4QfU';
div.appendChild(rec);
rec.appendChild(src);
So far so good. But, since http://api.recaptcha.net/challenge?k=6LfPJwgAAAAAAI-8F3Lp11umLntMpXov8Xfz4QfU contains document.write, you're screwed.
https://developer.mozilla.org/en/DOM/document.write wrote:
Writing to a document that has already loaded without calling document.open() will automatically perform a document.open call.
http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-75233634 wrote:
open
Open a document stream for writing. If a document exists in the target, this method clears it.