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

ʹÓÃJavaScriptºÍAjax·¢³öÒì²½ÇëÇóÏê½â

´ò¿ªÇëÇó
¡¡¡¡ÓÐÁËÒªÁ¬½ÓµÄ URL ºó¾Í¿ÉÒÔÅäÖÃÇëÇóÁË¡£¿ÉÒÔÓà XMLHttpRequest ¶ÔÏóµÄ open() ·½·¨À´Íê³É¡£¸Ã·½·¨ÓÐÎå¸ö²ÎÊý:
request-type:·¢ËÍÇëÇóµÄÀàÐÍ¡£µäÐ͵ÄÖµÊÇ GET »ò POST£¬µ«Ò²¿ÉÒÔ·¢ËÍ HEAD ÇëÇó¡£
url:ÒªÁ¬½ÓµÄ URL¡£
asynch:Èç¹ûÏ£ÍûʹÓÃÒì²½Á¬½ÓÔòΪ true£¬·ñÔòΪ false¡£¸Ã²ÎÊýÊÇ¿ÉÑ¡µÄ£¬Ä¬ÈÏΪ true¡£
username:Èç¹ûÐèÒªÉí·ÝÑéÖ¤£¬Ôò¿ÉÒÔÔÚ´ËÖ¸¶¨Óû§Ãû¡£¸Ã¿ÉÑ¡²ÎÊýûÓÐĬÈÏÖµ¡£
password:Èç¹ûÐèÒªÉí·ÝÑéÖ¤£¬Ôò¿ÉÒÔÔÚ´ËÖ¸¶¨¿ÚÁî¡£¸Ã¿ÉÑ¡²ÎÊýûÓÐĬÈÏÖµ¡£
¡¡¡¡Í¨³£Ê¹ÓÃÆäÖеÄÇ°Èý¸ö²ÎÊý¡£ÊÂʵÉÏ£¬¼´Ê¹ÐèÒªÒì²½Á¬½Ó£¬Ò²Ó¦¸ÃÖ¸¶¨µÚÈý¸ö²ÎÊýΪ “true”¡£ÕâÊÇĬÈÏÖµ£¬µ«¼á³ÖÃ÷È·Ö¸¶¨ÇëÇóÊÇÒì²½µÄ»¹ÊÇͬ²½µÄ¸üÈÝÒ×Àí½â¡£
¡¡¡¡½«ÕâЩ½áºÏÆðÀ´£¬Í¨³£»áµÃµ½ Çåµ¥ 9 ËùʾµÄÒ»ÐдúÂë¡£
¡¡¡¡Çåµ¥ 9. ´ò¿ªÇëÇó
   function getCustomerInfo() {
     var phone = document.getElementById("phone").value;
     var url = "/cgi-local/lookupCustomer.php?phone=" + escape(phone);
     request.open("GET", url, true);
   }
¡¡¡¡Ò»µ©ÉèÖúÃÁË URL£¬ÆäËû¾Í¼òµ¥ÁË¡£¶àÊýÇëÇóʹÓà GET ¾Í¹»ÁË(ºóÃæµÄÎÄÕÂÖн«¿´µ½ÐèҪʹÓà POST µÄÇé¿ö)£¬ÔÙ¼ÓÉÏ URL£¬Õâ¾ÍÊÇʹÓà open() ·½·¨ÐèÒªµÄÈ«²¿ÄÚÈÝÁË¡£
¡¡¡¡ÌôÕ½Òì²½ÐÔ
¡¡¡¡±¾ÏµÁеĺóÃæһƪÎÄÕÂÖУ¬ÎÒ½«Óúܶàʱ¼ä±àдºÍʹÓÃÒì²½´úÂ룬µ«ÊÇÄúÓ¦¸ÃÃ÷°×Ϊʲô open() µÄ×îºóÒ»¸ö²ÎÊýÕâôÖØÒª¡£ÔÚÒ»°ãµÄÇëÇó/ÏìӦģÐÍÖУ¬±ÈÈç Web 1.0£¬¿Í»§»ú(ä¯ÀÀÆ÷»òÕß±¾µØ»úÆ÷ÉÏÔËÐеĴúÂë)Ïò·þÎñÆ÷·¢³öÇëÇ󡣸ÃÇëÇóÊÇͬ²½µÄ£¬»»¾ä»°Ëµ£¬¿Í»§»úµÈ´ý·þÎñÆ÷µÄÏìÓ¦¡£µ±¿Í»§»úµÈ´ýµÄʱºò£¬ÖÁÉÙ»áÓÃijÖÖÐÎʽ֪ͨÄúÔڵȴý:
ɳ©(ÌرðÊÇ Windows ÉÏ)¡£
ÐýתµÄƤÇò(ͨ³£ÔÚ Mac »úÆ÷ÉÏ)¡£
Ó¦ÓóÌÐò»ù±¾É϶³½áÁË£¬È»ºó¹ýÒ»¶Îʱ¼ä¹â±ê±ä»¯ÁË¡£
¡¡¡¡ÕâÕýÊÇ Web Ó¦ÓóÌÐòÈÃÈ˸е½±¿×¾»ò»ºÂýµÄÔ­Òò —— ȱ·¦ÕæÕýµÄ½»»¥ÐÔ¡£°´Ï°´Å¥Ê±£¬Ó¦ÓóÌÐòʵ¼ÊÉϱäµÃ²»ÄÜʹÓã¬Ö±µ½¸Õ¸Õ´¥·¢µÄÇëÇóµÃµ½ÏìÓ¦¡£Èç¹ûÇëÇóÐèÒª´óÁ¿·þÎñÆ÷´¦Àí£¬ÄÇôµÈ´ýµÄʱ¼ä¿ÉÄܺܳ¤(ÖÁÉÙÔÚÕâ¸ö¶à´¦ÀíÆ÷¡¢DSL ûÓеȴýµÄÊÀ½çÖÐÊÇÈç´Ë)¡£
¡¡¡¡¶øÒì²½ÇëÇó²» µÈ´ý·þÎñÆ÷ÏìÓ¦¡£·¢ËÍÇëÇóºóÓ¦ÓóÌÐò¼ÌÐøÔËÐС£Óû§ÈÔÈ»¿ÉÒÔÔÚ Web ±íµ¥ÖÐÊäÈëÊý¾Ý£¬ÉõÖÁÀ뿪±íµ¥¡£Ã»ÓÐÐýתµÄƤÇò»òÕßɳ©£¬Ó¦ÓóÌÐòҲûÓÐÃ÷ÏԵĶ³½á¡£·þÎñÆ÷ÇÄÇĵØÏìÓ¦ÇëÇó£¬Íê³Éºó


Ïà¹ØÎĵµ£º

È«ÃæÀí½âjavascriptµÄcaller,callee,call,apply¸ÅÄî

Arguments
¸Ã¶ÔÏó´ú±íÕýÔÚÖ´Ðеĺ¯ÊýºÍµ÷ÓÃËüµÄº¯ÊýµÄ²ÎÊý¡£
[function.]arguments[n]
²ÎÊý
function £ºÑ¡Ïî¡£µ±Ç°ÕýÔÚÖ´ÐÐµÄ Function ¶ÔÏóµÄÃû×Ö¡£
n £ºÑ¡Ïî¡£Òª´«µÝ¸ø Function ¶ÔÏóµÄ´Ó0¿ªÊ¼µÄ²ÎÊýÖµË÷Òý¡£
˵Ã÷
ArgumentsÊǽøÐк¯Êýµ÷ÓÃʱ£¬³ýÁËÖ¸¶¨µÄ²ÎÊýÍ⣬»¹ÁíÍâ´´½¨µÄÒ»¸öÒþ²Ø¶ÔÏó¡£ArgumentsÊÇÒ»¸öÀàËÆ ......

javascript º¯Êý ºÍ CustomValidator¿Ø¼þÏà½áºÏʹÓÃ

<asp:TextBox ID="txtPwdPrompt" runat="server"></asp:TextBox>
<asp:CustomValidator id="CVPwdPrompt" runat="server" ClientValidationFunction="CheckPwd" ControlToValidate="txtPwdPrompt" ErrorMessage="<span style='font:12px'>ÌáʾÎÊÌâ±ØÐëÔÚ2-50¸ö×Ö·ûÄÚ</span>" Display="None"&g ......

css,javascriptµÄÔ¤¼ÓÔØ

ΪÁËÌá¸ßÍøÕ¾µÄ¼ÓÔØËٶȣ¬ÓÐÒ»¸öºÜÖØÒªµÄÊֶξÍÊÇÔÚÓû§ä¯ÀÀ¹ý³ÌÖеÄÉÏÓÎÍøÕ¾×öÒ»¸öÎļþµÄÔ¤¼ÓÔØ¡£Ô¤¼ÓÔØÎļþÒ»°ãÓÐÁ½ÖÖ³£Óõķ½Ê½£ºxhrºÍ¶¯Ì¬²åÈë½ÚµãµÄ·½Ê½¡£¶¯Ì¬²åÈë½ÚµãÊÇ×îΪ¼òµ¥Ò²×îΪ¹ã·ºµÄÒ»ÖÖÒì²½¼ÓÔØ·½Ê½(ÀýÈçyuiµÄGetÄ£¿é)£¬È»ºóʹÓö¯Ì¬²åÈë½Úµã·½·¨¼ÓÔصÄÎļþ¶¼»áÔÚ¼ÓÔغóÁ¢¼´Ö´ÐУ¬javascriptµÄÖ´ÐÐÒ»·½Ãæ»áÕ ......

AjaxÀúÏÕ¼Ç 1

½ñÌì³­Á˶ÎÊéÉÏС´úÂ룬´úÂëÈçÏÂ
<html>
<head>
<script type="text/javascript" src="zxml.src.js"></script>
<script type="text/javascript">
function start() {
var oXmlHttp = zXmlHttp.createRequest();
oXmlHttp.open("get", "info11.txt", true);
oXmlHttp.onreadystatecha ......

asp.net¶¯Ì¬×¢²ájavascript×ܽá

Ò».ʹÓÃRegisterStartUpScript×¢²áÖ»Ö´ÐÐÒ»´ÎµÄjavascript
µÚ1²½(´´½¨²¢×¢²á²¢Ê¹ÓÃjavascript)£ºPage.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
//´´½¨JavaScript
string info = "<mce:script type="text/javascript"><!--alert('ÄãºÃ£¬ÎÒÊÇXXX£¡')// --></mce:scrip ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ