470,647 Members | 1,212 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,647 developers. It's quick & easy.

http adjustment needed please.

13
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.


<script type="text/javascript" src="http://www.mooonbaby.com/test.js"></script>
<script type="text/javascript">
xmlhttp.open("GET", "test.txt",true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
alert(xmlhttp.responseText)
}
}
xmlhttp.send(null)
</script>
Dec 8 '06 #1
1 1037
Tami
13
I tried this but its still looking for a page not a divider.

</style>
<script type="text/javascript" src="http://www.mooonbaby.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>
Dec 8 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Cindy B | last post: by
reply views Thread by Gabriel Lozano-Morán | last post: by
1 post views Thread by Korara | last post: by
reply views Thread by warner | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.