关于javascript:AXJX的一些

3次阅读

共计 598 个字符,预计需要花费 2 分钟才能阅读完成。

1.AXJX 的实质
AJAX = 异步 JavaScript 和 XML,AJAX 是一种用于创立疾速动静网页的技术。
2. 它的四大根本步骤
(1)创立 XMLHttpRequest 对象
var=new XMLHttpRequest();
var=new ActiveXObject(“Microsoft.XMLHTTP”);(老版本的 Internet Explorer 模式)
(2)服务器响应
responseText- 取得字符串模式的响应数据。
responseXML- 取得 XML 模式的响应数据。

(3)建设链接(数据的交互)
xhr.open(“POST”,”demo_post.asp”,true);
(4)向服务器发送申请
xhr.send(); 发送申请(数据的交互)
当 xhr.open()中为true,则为异步,当 flase 时为同步。
3.AXJX

<html>
<body>

<div id="myDiv"><h3>Let AJAX change this text</h3></div>
<button type="button" onclick="loadXMLDoc()">Change Content</button>

</body>
</html>
<head>
<script type="text/javascript">
function loadXMLDoc()
{.... AJAX script goes here ...}
</script>
</head>
正文完
 0