本文详细介绍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' / titleGettin

作者: 来源: 时间: 17-11-23 16:11:28

代码如下:
<!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.readyState == 1) {
document.getElementById(''aja_cnts'').valuehttp://www.popasp.com/= '''';
document.getElementById(''aja_cnts'').valuehttp://www.popasp.com/= ''Loading...'';
}
if (request.readyState == 4) {
var answer = request.responseText;
document.getElementById(''aja_cnts'').valuehttp://www.popasp.com/= '''';
document.getElementById(''aja_cnts'').value = http://www.popasp.com/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="http://www.popasp.com/点击加载" />
<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"
%>
11
22
33
隐藏区块

会员注册

本功能为预留功能,暂不支持注册 ^_^

Login

社交帐号登陆

使用以下任意帐号可登陆本站

Close section
Close

联系我们

关于5UCMS 您有任何需求 均可以留言给我们