首页后端开发ASP.NETJs获取asp页面返回的值(加载值)实现代码

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

时间2024-02-07 14:52:03发布访客分类ASP.NET浏览339
导读:收集整理的这篇文章主要介绍了Js获取asp页面返回的值(加载值 实现代码,觉得挺不错的,现在分享给大家,也给大家做个参考。 复制代码 代码如下: <!DOCTYPE htML Pu...
收集整理的这篇文章主要介绍了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.readystate == 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实现随页面滚动显示/隐藏窗口固定位置元素
  • js,jquery滚动/跳转页面到指定位置的实现思路
  • js页面滚动时层智能浮动定位实现(jQuery/MooTools)
  • js点击返回跳转到指定页面实现过程
  • Javascript实现返回上一页面并刷新的小例子
  • Jquery Ajax 学习实例2 向页面发出请求 返回JSon格式数据
  • JS window.opener返回父页面的应用
  • JS实现页面进入和返回定位到具体位置

声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!


若转载请注明出处: Js获取asp页面返回的值(加载值)实现代码
本文地址: https://pptw.com/jishu/604184.html
asp中提示至少一个参数没有被指定值 解决方法 asp自动补全html标签自动闭合(正则表达式)

游客 回复需填写必要信息