Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

http adjustment needed.

Hi, how to make this alert the response text in a divider with the id of
"content" instead of the whole page of "test.txt" ? It works fine as it stands now, I just need it to show text in a div only and not the whole test.txt page. Thank you very much.

xmlhttp.open("GET", "test.txt",true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
alert(xmlhttp.responseText)
}
}
xmlhttp.send(null)

I tried this but its still looking for a page, not a divider.

</style>
<script type="text/javascript" src="http://www.website.com/test.js"></script>
<script type="text/javascript">
document.getElementById=("update_div");
xmlhttp.open("GET", "update_div",true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
alert(xmlhttp.responseText)
}
}
xmlhttp.send(null)
</script>
</head>
<body>
<div id="update_div">Testing this text to see if it appears. But it doesn't.</div>
</body>
</html>
[1128 byte] By [Melanie] at [2007-11-11 9:59:16]