Js获取asp页面返回的值(加载值)实现代码

发布时间:2022-04-17 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了Js获取asp页面返回的值(加载值)实现代码脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
复制代码 代码如下:

<!DOCTYPE htML PubLIC "-//W3C//DTD XHTML 1.0 TransITional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html XMlns="http://www.w3.org/1999/xhtml">
<head>
<;meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>Getting Server side data using AJAX</title>
</head>
<script>
function creat_Object() {
VAR xmlhttp;
if (!xmlhttp && typeof XMLHttPRequest != 'undefined') {
try {
xmlhttp = new XMLHttpRequest();
}
catch (e) {
alert("Your browser is not supporting XMLHTTPRequest"); <BR> xmlhttp = false;
}
}
else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
return xmlhttp;
}
var request = creat_Object();
function sever_interaction() {
if (request.ready@R_777_2358@e == 1) {
document.getElementById('aja_cnts').value = '';
document.getElementById('aja_cnts').value = 'Loading...';
}
if (request.readyState == 4) {
var answer = request.responseText;
document.getElementById('aja_cnts').value = '';
document.getElementById('aja_cnts').value = answer;
}
}
function call_server() {
request.open("GET", "Response.asp");
request.onreadystatechange = sever_interaction; request.send('');
}
</script>
<body>
<input type="button" name="BTnLoad" id="btnLoad" value="点击加载" onclick="call_server();" />
<input type="text" style=" width:265px; height:68px;" id="aja_cnts" />
</body>
</html>

获取页面Response.asp代码:document.getElementById('aja_cnts').value
Response.asp代码示例:
复制代码 代码如下:

<%
Response.Write "您好!欢迎光临悠9小店!"
Response.Write "我们的网址是:http://you9luck.taobao.COM"
%>

脚本宝典总结

以上是脚本宝典为你收集整理的Js获取asp页面返回的值(加载值)实现代码全部内容,希望文章能够帮你解决Js获取asp页面返回的值(加载值)实现代码所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。