ÍøÂçѧԺ w3popÉçÇø ÍøÂç×ÊÔ´ ITÐÂÎÅ

w3pop.com :: ÍøÂçѧԺ :: AJAX :: AJAX ·þÎñÆ÷¶Ë½Å±¾

»áÔ±µÇ½

ÕʺÅ

ÃÜÂë

»Ø´ð

¼ÇסÃÜÂë

Íü¼ÇÃÜÂë? ×¢²á

AJAX
AJAX ʵÀý
AJAXä¯ÀÀÆ÷
AJAXÔ´´úÂë
AJAX·þÎñ¶Ë
AJAX Êý¾Ý¿â
AJAXÓëXMLÎļþ
AJAX XMLHttpRequ..
΢ÈíµÄAjax
AJAX ½éÉÜ
AJAX HTTP ÇëÇó
AJAX ·þÎñÆ÷¶Ë½Å±..
AJAX Suggest °¸À..
AJAX ResponseXML
AJAX AppML

AJAX ·þÎñÆ÷¶Ë½Å±¾


×÷Õß:w3pop.com ·­Òë/ÕûÀí:w3pop.com ·¢²¼:2007-08-22 ÐÞ¸Ä:2007-08-22 ä¯ÀÀ:2933 :: ::

AJAX - The Server-Side ASP Script
AJAX - ·þÎñÆ÷¶ËASP½Å±¾³ÌÐò

Now we are going to create the script that displays the current server time.
ÏÖÔÚ£¬ÎÒÃÇÒª×ÅÊÖ´´½¨ÓÃÓÚÏÔʾ·þÎñÆ÷µ±Ç°Ê±¼äµÄ½Å±¾³ÌÐò¡£

The responseText property (explained in the previous chapter) will store the data returned from the server. Here we want to send back the current time. The code in "time.asp" looks like this:
“responseText” ÊôÐÔ £¨ÔÚǰ¼¸ÕÂÀïÒѾ­¶Ô¸ÃÊôÐÔ×÷ÁË˵Ã÷£©½«»á°Ñ·þÎñÆ÷¶Ë·µ»ØµÄÐÅÏ¢´¢´æÆðÀ´¡£ÔÚÕâÀÎÒÃÇÏ£Íû½«µ±Ç°Ê±¼ä·¢ËÍ»ØÈ¥¡£“time.asp” ÖеĴúÂëÈçÏÂËùʾ£º

<%
response.expires=-1
response.write(time)
%>

Note: The Expires property sets how long (in minutes) a page will be cached on a browser before it expires. If a user returns to the same page before it expires, the cached version is displayed. Response.Expires=-1 indicates that the page will never be cached.
×¢Ò⣺Expires ÊôÐÔ½«ÉèÖÃÒ»ÕÅÒ³ÃæÔÚä¯ÀÀÆ÷ÖеĻº´æÊ±¼ä£¨µ¥Î»£º·ÖÖÓ£©¡£Èç¹ûÔڸûº´æµ½ÆÚʱ´ò¿ªÏàͬµÄÒ³Ãæ£¬ÄÇô½«»áÏÔʾ»º´æËù´æ´¢µÄÐÅÏ¢ÄÚÈÝ¡£Response.Expires=-1 ±íʾ²»¶ÔÒ³Ãæ½øÐлº´æ¡£


Run Your AJAX Application
ÔËÐÐÄãµÄ AJAX Ó¦ÓóÌÐò

Try the AJAX application by typing some text into the Name text box below, then click inside the Time text box:
ÊÔ×ÅÔÚÏÂÃæµÄNameÎı¾¿òÄÚÊäÈëÐÅÏ¢£¬È»ºóµã»÷TimeÎı¾¿ò£¬²âÊÔÒ»ÏÂÕâ¸öAJAX³ÌÐò£º

Name: Time:

The Time text box gets the server's time from "time.asp" file without reloading the page!
TimeÎı¾¿ò½«»áÏÔʾÀ´×ÔÓÚ“time.asp”ÎļþÖеÄʱ¼ä£¬ÎÞÐëÖØÐ¼ÓÔØÒ³Ãæ¡£

ÆÀÂÛ (0) All