ajax ÇëÇóÓòÃû²»Í¬sessionÎÊÌâ
s.com ÓòÃûÏÂÓÐÒ»Îļþprocess.asp
VBScript code:
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "No-Cache"
Response.charset="gb2312"
response.Write Session("UserID")
ÏëÒªÔÚh.comÏÂÓÃajaxÀ´·ÃÎÊ
VBScript code:
response.Write getHTTPPage("http://s.com/process.asp")
Function getHTTPPage(url)
dim http
set http=Server.createobject("Msxml2.ServerXMLHTTP")
Http.open "get",url,false
Http.send()
if Http.readystate<>4 then
getHTTPPage = "error"
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=nothing
if err.number<>0 then Response.write(err.number)
End function
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End F
Ïà¹ØÎÊ´ð£º
ÔÚ¼ÒÑо¿ajax£¬¿´Á˱ðÈ˵ÄÒ»¸öÍøÉϹºÎïÉ̳ÇÏîÄ¿µÄÔ´´úÂ룬×Ô¼ºÒ²À´·Â±ðÈ˵Ķ«Î÷Á·Ï°Á·Ï°£¬Ã»Ïë³öÎÊÌâÁË£¡Ò»ÏµÄÕâЩ´úÂëÊÇÎÒ·ÂÕÕ±ðÈËдµÄ¡£ÎÒÊÇÏëÈÃ×¢²áµÄÈËÌîдÓû§Ãû£¬¹â±êÀ뿪Óû§ÃûºóÃæµÄÌîд¿Õ°×´¦ºóÁ¢¿ÌÀûÓÃaj ......
×î½üѧϰAJAX,²ÎÕÕhttp://dev.yesky.com/msdn/183/2426683.shtml×Ô¼º×öÁËÒ»¸öÁÐ×Ó£¬µ«ÊÇ×ÜÊÇÔÚJS´¦±¨´í_Default䶨Ò壬²»ÖªµÀʲôÔÒò¡£
Ç°Ì¨Ò³Ãæ£º
function comit_onclick()
{
¡¡var name=document. ......
Ò»¸öButton
Ò»¸öModalPopupExtender
Ò»¸öPanel
ÎÊÌâÊÇÕâÑùµÄ£ºÔÚ×öÐÞ¸Äʱºò µ±µãÐÞ¸ÄButton Panel ÏÔʾÁËÒ²ÓÐÒõӰЧ¹û£»
µ«ÊÇÎÒÐÞ¸ÄButtonÓÐbtn_Update_Clickʼþ£¬ÕâʼþÊǰó¶¨Êý¾ÝµÄ£»
ÏÖÔÚµÄÐ ......
¸÷λ:
ÎÒÏëʵÏÖ:Óû§ÔÚµã»÷Ò³ÃæµÄÌá½»°´Å¥(server¶Ë°´Å¥),ÏÈͨ¹ýÒ³ÃæAJAX¼ì²éÒ³ÃæÊý¾Ý,ÔÙ¸ù¾ÝÑéÖ¤µÄ½á¹û¾ö¶¨ÊÇ·ñÌá½»Êý¾Ý(Ìá½»Êý¾ÝµÄ´úÂëÊÇͨ¹ýSERVER¶Ë´úÂëÌá½»µÄ.
ÎÒÓÃÒÔÏ·½·¨,·¢ÏÖϵͳʵÏÖ²»ÁË:
......
Ïȼòµ¥ËµÃ÷Ï£¬ÎÒÒª×öµÄÕâ¸öÍøÕ¾Òª¿ª·¢Óû§×ÛºÏÉçÇø£¬ÎÒÃÇÀϰåÒªµÄ£¬ÏóQQÄÇÑùµÄÔÚÏß״̬£¬²¢ÇÒ¼´Ê±½ÓÊÕÏûÏ¢£¬¸ù¾ÝÔÚÏßʱ³¤¼ÆËã»ý·ÖµÈµÈ¡£ÎÒ¸úËû˵ÁËÕâÊÇÍøÕ¾£¬ÊÇWebÓ¦ÓóÌÐò£¬¸úQQÄÇWindowsÓ¦ÓóÌÐò²»Ì«Ò»Ñù£¬»¹Òª¿¼ ......