Dear colleagues:
I am sending this question in case someone would answer it. I have an external url (index4.html) in html that I would like to remove the body from and upload it to my current html page. I currently have this code in (index2.html):
<html>
<head>
<script type="text/javascript">
function makeHttpObject() {
try {return new XMLHttpRequest();}
catch (error) {}
try {return new ActiveXObject("Msxml2.XMLHTTP");}
catch (error) {}
try {return new ActiveXObject("Microsoft.XMLHTTP");}
catch (error) {}
throw new Error("Could not create HTTP request object.");
}
var request = makeHttpObject();
request.open("GET", "index4.html", true);
request.send(null);
request.onreadystatechange = function() {
if (request.readyState == 4)
var cosa = request.responseText;
var iFrameBody = cosa.getElementsByTagName('body')[0];
alert(iFrameBody);
};
</script>
</head>
<body>
</body>
</html>
Code index4.html:
<html>
<head>
</head>
<body>
Hello world!!
</body>
<html>
But I can not get an alert, let alone load it in the body.
If someone answered, I am grateful in advance. S @ | u2