欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Js獲取asp頁(yè)面返回的值(加載值)實(shí)現(xiàn)代碼

 更新時(shí)間:2012年12月20日 15:47:38   作者:  
本文詳細(xì)介紹Js獲取asp頁(yè)面返回的值(加載值)實(shí)現(xiàn)方法,需要了解的朋友可以參考下
復(fù)制代碼 代碼如下:

<!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="點(diǎn)擊加載" onclick="call_server();" />
<input type="text" style=" width:265px; height:68px;" id="aja_cnts" />
</body>
</html>

獲取頁(yè)面Response.asp代碼:document.getElementById('aja_cnts').value
Response.asp代碼示例:
復(fù)制代碼 代碼如下:

<%
Response.Write "您好!歡迎光臨悠9小店!"
Response.Write "我們的網(wǎng)址是:http://you9luck.taobao.com"
%>

相關(guān)文章

最新評(píng)論