一个简单的AJAX入门例子

<script>function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}</script>

<SCRIPT LANGUAGE="JavaScript">
var xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
xmlHttp.open("GET", "http://hi.baidu.com/mahaibao", true);
xmlHttp.onreadystatechange=function() {
if (xmlHttp.readyState==4) {
alert(xmlHttp.responseText);
}
}
xmlHttp.send();
</SCRIPT>

呵呵,简单吧

你可能感兴趣的:(JavaScript,C++,c,Ajax,C#)