asp ajax ²é¿´IPµÄËùÔÚµØ
index.aspÎļþ ±£´æutf-8
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
<form id="form1" name="form1" method="post">
<input name="ip" type="text" id="ip" style="width:170px" />
</form>
<mce:script type="text/javascript" src="ajaxrequest-min.js" mce_src="ajaxrequest-min.js"></mce:script>
<mce:script type="text/javascript"><!--
var ajax = new AJAXRequest(); // ´´½¨AJAX¶ÔÏó
function get() {
ajax.get("lookip.asp?ip=" + form1.ip.value, ShowMsg) //postÌá½» Öмä²ÎÊýΪ´«ËÍÄÚÈÝ
loadingtxt(txt); //loading¿ªÊ¼
}
function loadingtxt(txt) {
document.getElementById('txt').innerHTML = "Loading..."; //loading¿ªÊ¼
}
function ShowMsg(xmlobj) {
document.getElementById('txt').innerHTML = xmlobj.responseText; //ÏÔʾ»Øµ÷Êý¾Ý
}
// --></mce:script>
<div id="txt" style="float: left; background-color: #666666; color: #FFFFFF; font-size: 12px; width: 120px; height: 18px; text-align: center"></div>
<div style="float: left; background-color: #000000; color: #FFFFFF; font-size: 12px; width: 50px; height: 18px; cursor: pointer; text-align: center;" onclick="javascript: get();">²éѯIP</div>
lookip.asp ±£´æutf-8
<%
dim ip, url
ip=request("ip")
url="http://www.ip138.com/ips.asp?ip="&ip&"&action=2"
On Error Resume Next
function getHTTPPage(url)
dim Http
set Http=server.createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=nothing
if err.number<>0 then err.Clear
end function
'==================================================
'º¯ÊýÃû£ºGetBody
'×÷ Ó㺽ØÈ¡×Ö·û´®
'²Î Êý£ºConStr ------½«Òª½ØÈ¡µÄ×Ö·û´®
'²Î Êý£ºStartStr ------¿ªÊ¼×Ö·û´®
'²Î Êý£ºOverStr ------½áÊø×Ö·û´®
'²Î Êý£ºIncluL ------ÊÇ·ñ°üº¬StartStr
'²Î Êý£ºIncluR ------ÊÇ·ñ°üº¬OverStr
'=============
Ïà¹ØÎĵµ£º
Á˽âJavaScriptµÄÈ˶¼ÖªµÀJavaScriptµÄthis²»×ÜÊÇÖ¸Ïòµ±Ç°¶ÔÏ󣬺¯Êý»òÀàÖеÄthisÖ¸ÏòÓëµ÷ÓÃÕâ¸öº¯ÊýµÄ¶ÔÏóÒÔ¼°ÉÏÏÂÎÄ»·¾³ÊÇϢϢÏà¹ØµÄ¡£ÈçÔÚÈ«¾Ö×÷ÓÃÓòµ÷ÓÃÒ»¸öº¬thisµÄ¶ÔÏ󣬴Ëʱµ±Ç°¶ÔÏóµÄthisÖ¸ÏòµÄÊÇwindow¡£ÎªÁËÈÃthisµÄÖ¸Ïò·ûºÏ×Ô¼ºµÄÒâÔ¸£¬JavaScriptÌṩÁËÁ½¸ö·½·¨ÓÃÒԸıäthisµÄÖ¸Ïò£¬ËüÃÇÊÇcallºÍapply£¬µ±È»Ò²Ó ......
Ò»¡¢JSON ÊÇʲô£¿
JSON µÄÈ«³ÆÊÇJavaScript Object Notation£¬ÊÇÒ»ÖÖÇáÁ¿¼¶µÄÊý¾Ý½»»»¸ñʽ¡£
JSON ÓëXML ¾ßÓÐÏàͬµÄÌØÐÔ£¬ÀýÈçÒ×ÓÚÈ˱àдºÍÔĶÁ£¬Ò×ÓÚ»úÆ÷Éú³ÉºÍ½âÎö¡£µ«ÊÇJSON ±È
XML Êý¾Ý´«ÊäµÄÓÐЧÐÔÒª¸ß³öºÜ¶à¡£JSON ÍêÈ«¶ÀÁ¢Óë±à³ÌÓïÑÔ£¬Ê¹ÓÃÎı¾¸ñʽ±£´æ¡£
JSON Êý¾ÝÓÐÁ½Öֽṹ£º
• Name-Value ¶Ô¹¹³ÉµÄ¼¯ ......
Ò».ͨ¹ýjs·ÃÎÊFlex×é¼þ
1.×¼±¸¹¤×÷¡£ÏȽ¨Á¢Flex¹¤³Ì :fademo£¬²¢·ÅÖÃÒ»¸öÎı¾¿ò:txtName¡£×öÍêºó´úÂëÓ¦¸ÃÀàËÆÓÚÕâ¸öÑù×Ó£º
view plaincopy to clipboardprint?
·········10······· ......
×î½üÍøÉÏÌáµÄºÜ¶àµÄÒ»¸öиÅÄî¾ÍÊÇ AJAX ÁË, ÄÇô, AJAX ÊÇʲôÄØ? ÒÔÏÂÄÚÈÝÒýÓÃÍøÉÏ×ÊÁÏ:
AJAXÈ«³ÆΪ“Asynchronous JavaScript and XML”£¨Òì²½JavaScriptºÍXML£©£¬ÊÇÖ¸Ò»ÖÖ´´½¨½»»¥Ê½ÍøÒ³Ó¦ÓõÄÍøÒ³¿ª·¢¼¼Êõ¡£ËüÓлúµØ°üº¬ÁËÒÔϼ¸ÖÖ¼¼Êõ£º
Ajax£¨Asynchronous JavaScript + XML£©µÄ¶¨Òå
»ùÓÚ web±ê×¼£¨sta ......
Ajax¿ª·¢ÈËÔ±ÐèÒªµÄJavaScript֪ʶ
JavaScriptµ®ÉúÓÚ1995 Ä꣬×î×³ÉÔÚNetsCape Navigatorä¯ÀÀÆ÷ÖС£Microsoft ÔÚIE3Öм¯³É¡£1998Äê±»±ê×¼»¯ÎªECMAScript.
Microsoft Ajax Library¸ÄÉÆÁËJavaScriptµÄÃæÏò¶ÔÏóÄ£ÐÍ¡£
3.1ʹÓöÔÏó
JavaScriptÖеĶÔÏó²¢²»ÊÇÀàÐ͵ÄʵÀý£¬ÒòΪJavaScript²»Ö§³ ......