XML-txtHint-XMLHttpRequest Example
来源:互联网 发布:js数组对象常用方法 编辑:程序博客网 时间:2024/06/07 09:07
source: http://www.w3schools.com/xml/xml_http.asp
<script type="text/javascript">
function showHint(str)
{
if (str.length==0)
{
document.getElementById("txtHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{
xmlHttp=new XMLHttpRequest();
}
else // for older IE 5/6
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
var url="gethint.asp?q=" + str;
url=url+"&sid="+Math.random();
xmlHttp.open("GET",url,false);
xmlHttp.send();
document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
}
</script>
<hr />
<h2>XMLHttpRequest Example</h2>
<p>When you type a character in the input field below, an XMLHttpRequest is sent to the server
- and
name suggestions are returned (from a file on the server):</p>
<table width="100%" style="border:1px solid #d4d4d4;background-color:#e5eecc;background-image:url('/images/bgfadegreen.gif');background-repeat:repeat-x" id="table18">
<tr><td align="center">
<p class="intro">Type a letter in the input box:</p>
<p class="intro">First Name</p>
<input type="text" id="txt1" onkeyup="showHint(this.value)" />
<br />
<p class="intro">Suggestions:</p>
<p class="intro"><span id="txtHint"></span></p>
</td></tr></table>
<br />
<hr />
- XML-txtHint-XMLHttpRequest Example
- XML DOM - XMLHttpRequest 对象
- XML-DOM XMLHttpRequest 对象
- xml 笔记二 XMLHttpRequest
- XML DOM - XMLHttpRequest 对象
- XMLHttpRequest发送XML请求
- XML笔记-XMLHttpRequest对象
- XML by Example
- vtd xml example
- logback xml example
- XML(11) XML schema example
- XML DOM中XmlHttpRequest对象
- XML DOM - XMLHttpRequest 对象简介
- Ajax和XML中的XMLHttpRequest
- responseText属性,XMLHttpRequest,responseText,XML响应,XMLHttpRequest属性,
- XML Example With RESTEasy+ JAXB
- Spring Object/XML mapping example
- Spring Security + Hibernate XML Example
- hello,msdn
- 11.01.02 ~ 11.01.08
- 11.01.09 ~ 11.01.15
- 11.01.16 ~ 11.01.21
- XML-Entity References
- XML-txtHint-XMLHttpRequest Example
- "2010年度中国十大杰出IT博客" 评审
- 传点有用的东西
- 自己做了个文件比较器AceCompare
- SAP ABAP一个可以直接把内表转换成xml文件的函数
- UAC ADMIN
- zabbix
- 温暖的-我的冬天。
- 推荐一首好听的歌《阿尔香慕的等待》,约会的人最适合听了