Click to See Complete Forum and Search --> : http adjustment needed.


Melanie
12-08-2006, 12:39 AM
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>