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

JavaScriptʼþ°ó¶¨µÄ·½·¨ËµÃ÷ ÊÕ²Ø

JavaScriptʼþ°ó¶¨µÄ·½·¨ËµÃ÷ ÊÕ²Ø
ʼþʹµÃ¿Í»§¶ËµÄ JavaScript Óлú»á±»¼¤»î£¬²¢µÃÒÔÔËÐС£ÔÚÒ»¸ö Web Ò³Ãæ×°ÔØÖ®ºó£¬ÔËÐнű¾µÄΨһ·½Ê½£¬¾ÍÊÇÏìӦϵͳ»òÕßÓû§µÄ¶¯×÷¡£ËäÈ»´ÓµÚÒ»¸öÖ§³Ö½Å±¾±à³ÌµÄä¯ÀÀÆ÷ÃæÊÀÒÔÀ´£¬¼òµ¥µÄʼþ±»ÊµÏÖΪ JavaScript µÄÒ»²¿·Ö£»µ«ÊÇ´ó¶àÊý×î½ü³öÏÖµÄä¯ÀÀÆ÷¶¼ÊµÏÖÁËǿ׳µÄʼþÄ£ÐÍ£¬Ê¹½Å±¾¿ÉÒÔ¸ü¼ÓÖÇÄܵش¦Àíʼþ¡£ÏÖÔÚµÄÎÊÌâÔÚÓÚ£ºÎªÁËÖ§³Ö¸÷ÖÖä¯ÀÀÆ÷£¬Äú±ØÐëºÍ¶à¸öÏȽøµÄ ʼþÄ£ÐÍ×ö¶·Õù£¬×¼È·µØ˵£¬ÊÇÈý¸ö¡£
   ÕâÈý¸öʼþÄ£ÐÍ·Ö±ðºÍÏÂÃæµÄÎĵµ¶ÔÏóÄ£ÐÍ£¨Document Object Model£¬¼´ DOM£©Èý¾ÞÍ·½áÃË£ºNetscape Navigator 4 (NN4)£¬Macintosh ºÍ Windows ϵͳµÄ Internet Explorer 4 ¼°Æä¸üа汾(IE4+)£¬ÒÔ¼°ÔÚ Safari Öеõ½ÊµÏÖµÄ W3C DOM¡£¾¡¹ÜÕâЩģÐÍÖ®¼äÓÐЩµØ·½´æÔÚһЩ±¾ÖʵIJî±ð£¬µ«ÊÇÔÚһЩ¼òÒ×µÄ JavaScript µÄ°ïÖúÏ£¬ËüÃǶ¼¿ÉÒÔͬʱÊÊÓÃÓÚͬһ¸öÎĵµ¡£±¾ÎÄÖ÷Òª×ÅÑÛÓÚÏ໥³åÍ»µÄʼþÄ£ÐÍÖеÄÁ½¸ö¹Ø¼ü·½Ã棺
    ·°ÑÒ»¸öʼþºÍ HTML ÔªËØ°ó¶¨ÆðÀ´µÄ·½·¨¡£
    ·ÔÚʼþ±»´¥·¢ºóÈçºÎ¶ÔÖ®½øÐд¦Àí¡£
ʼþ°ó¶¨µÄ·½·¨
   ʼþ°ó¶¨ÊÇÖ¸¹¹ÔìÒ»¸öÏìӦϵͳ»òÕßÓû§¶¯×÷µÄ HTML ÔªËصĹý³Ì¡£ÔÚ²»Í¬µÄä¯ÀÀÆ÷°æ±¾ÖУ¬Óв»ÉÙÓÚÎåÖÖʼþ°ó¶¨¼¼Êõ¡£ÏÂÃæÎÒÃÇ¿ìËٵؽéÉÜÒ»ÏÂÕâЩ¼¼Êõ¡£
ʼþ°ó¶¨·½·¨I£º°ó¶¨ÔªËØÊôÐÔ
×î¼òµ¥ºÍÏòºó¼æÈÝÐÔ×îºÃµÄʼþ°ó¶¨·½·¨ÊÇ°Ñʼþ°ó¶¨µ½ÔªËرêʶµÄÊôÐÔ¡£Ê¼þÊôÐÔÃû³ÆÓÉʼþÀàÐÍÍâ¼ÓÒ»¸ö“on”ǰ׺¹¹³É¡£¾¡¹ÜHTMLÊôÐÔ²¢²»ÊÇ´óСдÃô ¸ÐµÄ£¬ÈËÃÇ»¹ÊǶ¨ÒåÁËÒ»¸ö¹æÔò£¬¹æ¶¨Ê¼þÀàÐ͵Äÿһ¸ö“´Ê”µÄÊ××Öĸ´óд£¬±ÈÈç onClick ºÍ onMouseOver¡£ÕâЩÊôÐÔÒ²±»³ÆΪʼþ´¦ÀíÆ÷£¬ÒòΪËüÃÇָʾÁËÔªËØÈçºÎ“´¦Àí”Ìض¨µÄʼþÀàÐÍ¡£
ÕýÈ·µÄʼþ´¦ÀíÆ÷ÊôÐÔµÄÖµÔÚÐÎʽÉÏÊDZ»ÒýºÅ°üº¬µÄ JavaScript Óï¾ä¡£×î³£¼ûµÄÖµÊÇÒ»Ìõµ÷ÓÃij¸ö½Å±¾º¯ÊýµÄÓï¾ä£¬¶ø±»µ÷Óõĺ¯ÊýÔÚλÓÚ
ÎĵµÇ°²¿µÄ <SCRIPT> ±êʶÖж¨Òå--¸Ã±êʶͨ³£Î»ÓÚ <HEAD> ²¿·Ö¡£¾ÙÀýÀ´Ëµ£¬ÏÂÃæµÄº¯Êý£º
function myFunc() {
      // script statements here
}
¿ÉÒÔ±»¶¨ÒåΪһ¸ö°´¼ü¿Ø¼þµÄʼþ´¦ÀíÆ÷£¬°´¼üµÄ¶¨ÒåÈçÏ£º
<INPUT TYPE="button" NAME="myButton" VALUE="Click Here"
onClick="myFunc()">
°Ñʼþ°ó¶¨µ½ÔªËØÊôÐÔÉÏÓÐÒ»¸öÓŵ㣬¼´¿ÉÒÔÖ§³Ö¿ª·¢Õ߰ѲÎÊý´«µÝ¸øʼþ´¦ÀíÆ


Ïà¹ØÎĵµ£º

css,javascriptµÄÔ¤¼ÓÔØ

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

javascript ÅжÏÎļþÀàÐÍ


function checkfiletype()
{
   var fileName = document.getElementById('<%=FilePath.ClientID%>').value;
   if (Trim(fileName)=="")
        {
            alert("ÇëÑ¡ÔñÒªÉÏ´«µÄÎļþ£¡");
     ......

JavaScript ½âÎö JSON Êý¾Ý

JSON £¨JavaScript Object Notation£©Ò»ÖÖ¼òµ¥µÄÊý¾Ý¸ñʽ£¬±Èxml¸üÇáÇÉ¡£ JSON ÊÇ JavaScript Ô­Éú¸ñʽ£¬ÕâÒâζ×ÅÔÚ JavaScript Öд¦Àí JSON Êý¾Ý²»ÐèÒªÈκÎÌØÊâµÄ API »ò¹¤¾ß°ü¡£
JSONµÄ¹æÔòºÜ¼òµ¥£º ¶ÔÏóÊÇÒ»¸öÎÞÐòµÄ“‘Ãû³Æ/Öµ’¶Ô”¼¯ºÏ¡£Ò»¸ö¶ÔÏóÒÔ“{”£¨×óÀ¨ºÅ£©¿ªÊ¼£¬“}&rdq ......

javascriptÖÐÈÕÆÚº¯ÊýDateÏê½â

¶ÔÏó: ÈÕÆÚ
DateÊÇjavascriptÔ¤¶¨ÒåÖ÷Ìâ. ¸ÃÖ÷Ìâ°üÀ¨¿É»ñÈ¡»òÉèÖÃϵͳÈÕÆÚ¡¢Ê±¼ä¡¢Ô¡¢ÈÕ¡¢Ð¡Ê±¡¢·ÖÖÓ¡¢ÃëµÈµÈ¡£°üÀ¨º¯Êý·½·¨»ñÈ¡ UTC ¸ñʽµÄÈÕÆÚ¡£ UTC Êǹú¼Ê±ê׼ʱ¼ä£¬Ò²³Æ¸ñÁÖÄáÖαê׼ʱ¼ä£¨Greenwich Mean Time£©¡£
ÔÚʹÓÃÕâЩ·½·¨Ç°¿ÉÏÈÉùÃ÷Ò»¸öÖ÷Ìâ¡£
´´½¨ÐÂÈÕÆÚÖ÷Ìâ
ʾÀý´úÂ룺var exd = new Date();
µ÷ÓÃ"n ......

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

´ò¿ªÇëÇó
¡¡¡¡ÓÐÁËÒªÁ¬½ÓµÄ URL ºó¾Í¿ÉÒÔÅäÖÃÇëÇóÁË¡£¿ÉÒÔÓà XMLHttpRequest ¶ÔÏóµÄ open() ·½·¨À´Íê³É¡£¸Ã·½·¨ÓÐÎå¸ö²ÎÊý:
request-type:·¢ËÍÇëÇóµÄÀàÐÍ¡£µäÐ͵ÄÖµÊÇ GET »ò POST£¬µ«Ò²¿ÉÒÔ·¢ËÍ HEAD ÇëÇó¡£
url:ÒªÁ¬½ÓµÄ URL¡£
asynch:Èç¹ûÏ£ÍûʹÓÃÒì²½Á¬½ÓÔòΪ true£¬·ñÔòΪ false¡£¸Ã²ÎÊýÊÇ¿ÉÑ¡µÄ£¬Ä¬ÈÏΪ true¡£
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ