ÄÇЩÏà¼ûºÞÍíµÄ JavaScript ¼¼ÇÉ
JavaScript µÄ³É¹¦ÈÃÈ˽ò½òÀÖµÀ£¬Îª Web ÍøÒ³±àд JavaScript ´úÂëÒѾÊÇËùÓÐ Web Éè¼ÆʦµÄ»ù±¾¹¦£¬ÕâÃÅÓÐȤµÄÓïÑÔÔ̲Ø×ÅÐí¶à²»ÎªÈËÊìÖªµÄ¶«Î÷£¬¼´Ê¹¶àÄêµÄ JavaScript ³ÌÐòÔ±£¬Ò²Î´ÄÜÍêÈ«³Ô͸¡£±¾ÎÄ´Ó7¸ö·½Ãæ½²Êö JavaScript ÖÐÄÇЩÄã²»ºÜÊìÖªµ«·Ç³£ÊµÓõļ¼ÇÉ¡£
¼òÂÔÓï¾ä
JavaScript ¿ÉÒÔʹÓüòÂÔÓï¾ä¿ìËÙ´´½¨¶ÔÏóºÍÊý×飬±ÈÈçÏÂÃæµÄ´úÂ룺
¿ÉÒÔʹÓüòÂÔÓï¾äÈçÏ£º
¶ÔÏó car ¾Í´Ë´´½¨£¬²»¹ýÐèÒªÌرð×¢Ò⣬½áÊø»¨À¨ºÅÇ°Ò»¶¨²»Òª¼Ó ";" ·ñÔòÔÚ IE »áÓöµ½ºÜ´óÂé·³¡£
´´½¨Êý×éµÄ´«Í³·½·¨ÊÇ£º
ʹÓüòÂÔÓï¾äÔò£º
ÁíÒ»¸ö¿ÉÒÔʹÓüòÂÔÓï¾äµÄµØ·½ÊÇÌõ¼þÅжÏÓï¾ä£º
¿ÉÒÔ¼òÂÔΪ£º
JSON Êý¾Ý¸ñʽ
JSON ÊÇ "JavaScript Object Notation" µÄËõд£¬ÓÉ Douglas Crockford Éè¼Æ£¬JSON ¸Ä±äÁË JavaScript ÔÚ»º´æ¸´ÔÓÊý¾Ý¸ñʽ·½ÃæµÄÀ§¾³£¬ÈçÏÂÀý£¬¼ÙÈçÄãÒªÃèÊöÒ»¸öÀÖ¶Ó£¬¿ÉÒÔÕâÑùд£º
Äã¿ÉÒÔÔÚ JavaScript ÖÐÖ±½ÓʹÓà JSON£¬ÉõÖÁ×÷ΪijЩ API µÄ·µ»ØÊý¾Ý¶ÔÏó£¬ÒÔÏ´úÂëµ÷ÓÃÖøÃûÊéÇ©ÍøÕ¾ delicious.com µÄÒ»¸ö API£¬·µ»ØÄãÔÚ¸ÃÍøÕ¾µÄËùÓÐÊéÇ©£¬²¢ÏÔʾÔÚÄã×Ô¼ºµÄÍøÕ¾£º
JavaScript ±¾µØº¯Êý (Math, Array ºÍ String)
JavaScript ÓкܶàÄÚÖú¯Êý£¬ÓÐЧµÄʹÓ㬿ÉÒÔ±ÜÃâºÜ¶à²»±ØÒªµÄ´úÂ룬±ÈÈ磬´ÓÒ»¸öÊý×éÖÐÕÒ³ö×î´óÖµ£¬´«Í³µÄ·½·¨ÊÇ£º
ʹÓÃÄÚÖú¯Êý¿ÉÒÔ¸üÈÝÒ×ʵÏÖ£º
ÁíÒ»¸ö·½·¨ÊÇʹÓà Math.max() ·½·¨£º
Äã¿ÉÒÔÓÃÕâ¸ö·½·¨°ïÖú̽²âä¯ÀÀÆ÷
Õâ½â¾öÁË IE ä¯ÀÀÆ÷µÄÒ»¸öÎÊÌ⣬ͨ¹ýÕâÖÖ·½·¨£¬Äã×ÜÊÇ¿ÉÒÔÕÒµ½ÄǸöÕýÈ·µÄÖµ£¬ÒòΪä¯ÀÀÆ÷²»Ö§³ÖµÄÄǸöÖµ»á·µ»Ø undefined¡£
»¹¿ÉÒÔʹÓà JavaScript ÄÚÖÃµÄ split() ºÍ join() º¯Êý´¦Àí HTML ¶ÔÏóµÄ CSS ÀàÃû£¬Èç¹û HTML ¶ÔÏóµÄÀàÃûÊÇ¿Õ¸ñ¸ô¿ªµÄ¶à¸öÃû×Ö£¬ÄãÔÚΪËü×·¼Ó»òɾ³ýÒ»¸ö CSS ÀàÃûµÄʱºòÐèÒªÌرð×¢Ò⣬Èç¹û¸Ã¶ÔÏó»¹Ã»ÓÐÀàÃûÊôÐÔ£¬¿ÉÒÔÖ±½Ó½«ÐµÄÀàÃû¸³ÓèËü£¬Èç¹ûÒѾ´æÔÚÀàÃû£¬ÐÂÔöµÄÀàÃûÇ°±ØÐëÓÐÒ»¸ö¿Õ¸ñ£¬Óô«Í³µÄ JavaScript ·½·¨ÊÇÕâÑùʵÏֵģº
ʹÓà split ºÍ join ·½·¨ÔòÖ±¹ÛÓÅÑŵöࣺ
ʼþ´úÀí
ÓëÆäÔÚ HTML ÎĵµÖÐÉè¼ÆÒ»¶Ñʼþ£¬²»ÈçÖ±½ÓÉè¼ÆÒ»¸öʼþ´úÀí£¬¾ÙÀý˵Ã÷£¬¼ÙÈçÄãÓÐһЩÁ´½Ó£¬Óû§µã»÷ºó²»Ïë´ò¿ªÁ´½Ó£¬¶øÊÇÖ´ÐÐij¸öʼþ£¬HTML ´úÂëÈçÏ£º
´«Í³µÄʼþ´¦ÀíÊDZéÀú¸÷¸öÁ´½Ó£¬¼ÓÉϸ÷×ÔµÄʼþ´¦Àí£º
ʹÓÃʼþ´úÀí£¬¿ÉÒÔÖ±½Ó´¦Àí£¬ÎÞÐè±éÀú£º
ÄäÃûº¯ÊýÓë Module ģʽ
JavaScript µÄÒ»¸öÎÊÌâÊÇ£¬ÈκαäÁ¿£¬º¯Êý»òÊǶÔÏ󣬳ý·ÇÊÇÔÚij¸öº¯ÊýÄÚ²¿¶¨Ò壬·ñÔò£¬¾ÍÊÇÈ«¾ÖµÄ£¬Òâζ×ÅͬһÍøÒ³µÄ±ðµ
Ïà¹ØÎĵµ£º
1 javascript ÕýÔò
¶ÔÏó´´½¨ ºÍÓ÷¨
ÉùÃ÷javascript ÕýÔò
±í´ïʽ
¸´ÖÆ´úÂë
´úÂëÈçÏÂ:
var reCat = new RegExp("cat");
ÄãÒ²¿ÉÒÔ
var reCat = /cat/; //Perl ·ç¸ñ £¨ÍƼö£©
2 ѧϰ×î³£ÓÃµÄ test exec match search replace split 6¸ö·½·¨
1£© test ¼ì²éÖ¸¶¨µÄ×Ö·û´®ÊÇ·ñ´æÔÚ
¸´ÖÆ´úÂë
......
±íµ¥Ð§¹û£ºhttp://www.sprymedia.co.uk/article/KeyTable
±íµ¥Ð§¹û£ºhttp://www.datatables.net/examples/
ͼ±íЧ¹û£º http://filamentgroup.com/dwpe/#codeexamples
ͼ±íЧ¹û£º http://people.iola.dk/olau/flot/examples/
±íµ¥Ð§¹û£ºhttp://www.reconstrukt.com/ingrid/src/example1.html#
Ê÷ÐÎĿ¼£ºhttp ......
¸ÐлÈñÉÌÆóÒµCMSµÄͶµÝ
ÐÂÎÅÀ´Ô´:Smashing Magazine
JavaScript µÄ³É¹¦ÈÃÈ˽ò½òÀÖµÀ£¬Îª Web ÍøÒ³±àд JavaScript ´úÂëÒѾÊÇËùÓÐ Web Éè¼ÆʦµÄ»ù±¾¹¦£¬ÕâÃÅÓÐȤµÄÓïÑÔÔ̲Ø×ÅÐí¶à²»ÎªÈËÊìÖªµÄ¶«Î÷£¬¼´Ê¹¶àÄêµÄ JavaScript ³ÌÐòÔ±£¬Ò²Î´ÄÜÍêÈ«³Ô͸¡£±¾ÎÄ´Ó7¸ö·½Ãæ½²Êö JavaScript ÖÐÄÇЩÄã²»ºÜÊìÖªµ«·Ç³£ÊµÓõļ¼ÇÉ¡£
¼òÂ ......
javascriptʼþÇý¶¯¿ò¼Ü ÊÕ²Ø
Ò»¸ö¼òµ¥µÄʼþÇý¶¯¿ò¼ÜµÄÑÝʾ£º
/*ControlDemo.js*/
//ʼþÇý¶¯¿ò¼Ü£¨ÑÝʾ£©
function ControlDemo(page)
{
//³õʼ»¯Page
if (page == null)
{
page = self;
}
if (page != self)
{
//Do sth. here...
}
&nb ......