The script does window.open(”,…) and then writes xmlhttp.responseText by doing innerHTML=xmlhttp.responseText, but the script doesn’t load.
The script does window.open(”,…) and then writes xmlhttp.responseText by doing innerHTML=xmlhttp.responseText, but the script
Share
Typically, you would get the xmlhttp request response as pure Javascript and then use the Javascript eval() function:
In this case, you would NOT treat it as HTML. Instead, you would return pure code. The difference:
Don’t do this in your page you call
Do this instead
So that, in effect this is what happens:
But you don’t want this to happen:
There are some issues associated with doing it this way, such as eval can be slow. Google javascript eval to see what others have to say.
=== EDIT ===
Using a DOM method as opposed to xmlhttprequest may actually be what the original poster is needing to do here, which is load a Google captcha code dynamically.
Additionally, if you need it to land somewhere, you can do something like: