Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

jquery+ajax+json+asp.netѧϰ±Ê¼Ç£¨Ò»£©

jqueryÖÐÒѾ­·â×°ÁËajaxµÄ¹ý³Ì£¬Ê¹ÓÃÆðÀ´ºÜ¼òµ¥£º
ͨ¹ýget·½Ê½Ìá½»£º
<html>
<head>
    <title>ʵÏÖ·þÎñÆ÷ʱ¼äʵʱ±ä»¯</title>
    <script language="javascript" type="text/javascript" src="js/jquery-1.3.1.js"></script>
    <script language="javascript" type="text/javascript">
        $(document).ready(function(){
            $("#gettime").click(function(){
                    setInterval(function(){getcurtime()},1000);//settimeoutºÍsetinterval¶¼ÊÇÑÓ³ÙÒ»ÃëÖ´ÐУ¬µ«ÊÇsettimeout²»»áÿ¸ôÒ»ÃëÖ´ÐÐÒ»´Î£¬¶øsetinterval¿ÉÒÔʵÏÖ
                });
           });
            function getcurtime()
            {
                $.get("getCurTime.aspx",function(response){
                $("#curtime").text(response);});
            }
       
    </script>
</head>
<body>
<div id="gettime">click here to get current time</div>
<div id="curtime"></div>
</body>
</html>
ÒÔÉÏ´úÂëʵÏÖÁËʱ¼äµÄʵʱˢУ¬µ«ÊÇÎҼǵÃÒÔǰÓÃsettimeoutºÍsetinterval¶¼¿ÉÒÔʵÏÖʵʱˢУ¬µ«ÊÇÎÒÔÚ±¾µØ²âÊԵĽá¹ûÊÇsettimeout²»ÄÜʵÏִ˹¦ÄÜ£¬Ö»ÄÜʵÏÖÍÆ³Ù£¬²»ÖªµÀÊÇʲôԭÒò£¬Ï£Íû¸ßÊÖÖ¸µã


Ïà¹ØÎĵµ£º

ajax´´½¨XMLHttpRequest¶ÔÏó

function ajaxFunction()
{
var xmlHttp;

try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
......

½Ó´¥AjaxµÄµÚÒ»¸öʵÑéHello Word

<html>
<head>
<title>new ajax</title>
<mce:style type="text/css"><!--
body{
margin-top:50px;
}
.MyDiv{
font-size:12px;
border:1px solid #DDD;
background-color:#FFD;
margin:2px;
width:200px;
}

--></mce:style><style type="t ......

¼òµ¥AjaxÓëJSPÏà½áºÏÒ³Ãæ

»·¾³£ºAjax+JSP£¬Tomcat5.05
²Î¿¼£ºhttp://www.w3cschool.cn/index-24.asp.htm
Îļþ£ºtestAjax.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb ......

DWR ·´×ªAJAX µ¥Ï߳̿ØÖÆSESSION

Ä¿µÄ£ºÍ¨¹ýÒ»¸öỊ̈߳¬ÅжÏSESSIONÊÇ·ñ¹ýÆÚ£¬Èç¹û¹ýÆÚ£¬µ÷Óÿͻ§¶ËÒ³ÃæµÄJS£¬°ÑÐÅÏ¢ÍÆ¸ø¿Í»§¶Ë¡£
ÎÒÃÇÒªÈÃDWR³ÌÐòÖ§³Ö·´ÏòAJAX¡£ÐèÒªÔÚweb.xmlÖÐDWRServletÀïÌí¼ÓÒ»¸ö³õʼ»¯²ÎÊý£¬ÁíÍâÒªÅäÖÃÒ»¸ö¼àÌýÆ÷£¬ÔÚÊʺϵÄʱºò¹Ø±ÕÏ̡߳£
ÈçÏÂÊÇweb.xmlÖеÄÅäÖÃ
<listener>
        < ......

ASP.NETС¼¼ÇÉ.txt

Ò».Response¶ÔÏóµÄWrite·½·¨ÓëJavaScript½Å±¾ÓïÑԵĽáºÏʹÓÃ.(page_51)
µ¯³öÌáʾ¶Ô»°¿ò.
Response.Write("<script>alert('ÄãºÃ!');</script>");
   2.¹Ø±Õ´°¿Ú
Response.Write("<script>window.opener=null;window.close();script>");
¶þ.»ñÈ¡¿Í»§¶ËIPµØÖ·.(page_54)
1. ͨ¹ýRequestµ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ