📄 dom_http.asp@output=print
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>XML DOM - HttpRequest object</title>
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="Keywords" content="xml,tutorial,html,dhtml,css,xsl,xhtml,javascript,asp,ado,vbscript,dom,sql,colors,soap,php,authoring,programming,training,learning,beginner's guide,primer,lessons,school,howto,reference,examples,samples,source code,tags,demos,tips,links,FAQ,tag list,forms,frames,color table,w3c,cascading style sheets,active server pages,dynamic html,internet,database,development,Web building,Webmaster,html guide" />
<meta name="Description" content="Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building." />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "../../https@ssl./default.htm" : "../../www./default.htm");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3855518-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
</head>
<body>
<p>From <b>http://www.w3schools.com</b> (Copyright Refsnes Data)</p>
<h1> The XMLHttpRequest Object</h1>
<a href="dom_comment.asp"><img border="0" src="../images/btn_previous.gif" alt="prev" width="100" height="20" /></a>
<a href="dom_errors.asp"><img border="0" src="../images/btn_next.gif" alt="next" width="100" height="20" /></a>
<hr />
<h2>Examples</h2>
<p><a target="_blank" href="tryit.asp@filename=try_dom_httprequest_js1">Load a
textfile into a div element with XML HTTP</a></p>
<p><a target="_blank" href="tryit.asp@filename=try_dom_httprequest_js2">Make a
HEAD request with XML HTTP</a></p>
<p><a target="_blank" href="tryit.asp@filename=try_dom_httprequest_js3">Make a
specified HEAD request with XML HTTP</a></p>
<p><a target="_blank" href="tryit.asp@filename=try_dom_httprequest_js4">List data from an XML file with XML HTTP</a></p>
<hr />
<h2>The XMLHttpRequest Object Reference</h2>
<h3>Methods</h3>
<table class="ex" cellspacing="0" border="1" width="100%" cellpadding="3" id="table11">
<tr valign="top">
<th width="45%" align="left">Method</th>
<th width="55%" align="left">Description</th>
</tr>
<tr valign="top">
<td>abort()</td>
<td>Cancels the current request</td>
</tr>
<tr valign="top">
<td><a href="met_http_getallresponseheaders.asp">getAllResponseHeaders()</a></td>
<td>Returns the complete set of http headers as a string</td>
</tr>
<tr valign="top">
<td><a href="met_http_getresponseheader.asp">getResponseHeader("headername")</a></td>
<td>Returns the value of the specified http header</td>
</tr>
<tr valign="top">
<td>open("method","URL",async,"uname","pswd")</td>
<td>Specifies the method, URL, and other optional attributes of a
request<p>The method parameter can have a value of "GET", "POST",
or "PUT" (use "GET" when requesting data and use "POST"
when sending data (especially if the length of the data is
greater than 512 bytes.</p>
<p>The URL parameter may be either a relative or
complete URL.</p>
<p>The async parameter specifies
whether the request should be handled asynchronously or not. true means
that script
processing carries on after the send() method, without waiting for a response. false
means that the script waits for a response before continuing script
processing</p></td>
</tr>
<tr valign="top">
<td>send(content)</td>
<td>Sends the request</td>
</tr>
<tr valign="top">
<td>setRequestHeader("label","value")</td>
<td>Adds a label/value pair to the http header to be sent</td>
</tr>
</table>
<h3>Properties</h3>
<table class="ex" cellspacing="0" border="1" width="100%" cellpadding="3" id="table12">
<tr valign="top">
<th width="30%" align="left">Property</th>
<th width="70%" align="left">Description</th>
</tr>
<tr valign="top">
<td>onreadystatechange</td>
<td>An event handler for an event that fires at every state change</td>
</tr>
<tr valign="top">
<td>readyState</td>
<td>Returns the state of the object:<p>0 = uninitialized<br />
1 = loading<br />
2 = loaded<br />
3 = interactive<br />
4 = complete </p></td>
</tr>
<tr valign="top">
<td>responseText</td>
<td>Returns the response as a string</td>
</tr>
<tr valign="top">
<td>responseXML</td>
<td>Returns the response as XML. This property returns an XML document
object, which can be examined and parsed using W3C DOM node tree methods and
properties</td>
</tr>
<tr valign="top">
<td>status</td>
<td>Returns the status as a number (e.g. 404 for "Not Found" or 200 for
"OK")</td>
</tr>
<tr valign="top">
<td>statusText</td>
<td>Returns the status as a string (e.g. "Not Found" or
"OK")</td>
</tr>
</table>
<br />
<hr />
<a href="dom_comment.asp"><img border="0" src="../images/btn_previous.gif" alt="prev" width="100" height="20" /></a>
<a href="dom_errors.asp"><img border="0" src="../images/btn_next.gif" alt="next" width="100" height="20" /></a>
<p>From <b>http://www.w3schools.com</b> (Copyright Refsnes Data)</p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -