Javascript——±Õ°ü
×î½üÕâ¶Îʱ¼äÒ»Ö±ÔÚ¸ãÇ°¶ËJavaScript£¬ÒÔÇ°×ܾõµÃJSûʲô¸ãÍ·£¬¾¹ýÕâÒ»¶ÎµÄÓ¦Ó㬲ŷ¢ÏÖJsÀïÃæµÄ¶«Î÷ÕæµÄºÜÉîºÜÉîµÄ£¬²»È»ÎªÊ²Ã´¸÷´óÃÅ»§ÍøÕ¾¶¼ÕÐÒ»ÅúJS¹¤³ÌʦÄØ¡£
Ïл°²»Ëµ£¬ÏÖÔÚ¿´¿´JavaScript
ÀïµÄ±Õ°ü
¡£
Òª³ÉΪ¸ß¼¶ JavaScript ³ÌÐòÔ±£¬¾Í±ØÐëÀí½â±Õ°ü¡£
±¾ÎĽáºÏ ECMA 262 ¹æ·¶Ïê½âÁ˱հüµÄÄÚ²¿¹¤×÷»úÖÆ£¬Èà JavaScript
±à³ÌÈËÔ±¶Ô±Õ°üµÄÀí½â´Ó“ǶÌ׵ĺ¯Êý”ÉîÈëµ½“±êʶ·û½âÎö¡¢Ö´Ðл·¾³ºÍ×÷ÓÃÓòÁ´”µÈµÈ JavaScript ¶ÔÏ󱳺óµÄÔËÐлúÖƵ±ÖУ¬ÕæÕýÁì»áµ½±Õ°üµÄʵÖÊ¡£
ÔÎÄÁ´½Ó£ºJavaScript Closures
¿É´òÓ¡°æ£ºJavaScript ±Õ°ü
Ŀ¼
¼ò½é
¶ÔÏóÊôÐÔÃû½âÎö
ÖµµÄ¸³Óè
ÖµµÄ¶ÁÈ¡
±êʶ·û½âÎö¡¢Ö´Ðл·¾³ºÍ×÷ÓÃÓòÁ´
Ö´Ðл·¾³
×÷ÓÃÓòÁ´Óë
[[scope]]
±êʶ·û½âÎö
±Õ°ü
×Ô¶¯À¬»øÊÕ¼¯
¹¹³É±Õ°ü
ͨ¹ý±Õ°ü¿ÉÒÔ×öʲô£¿
Àý
1£ºÎªº¯ÊýÒýÓÃÉèÖÃÑÓʱ
Àý
2£ºÍ¨¹ý¶ÔÏóʵÀý·½·¨¹ØÁªº¯Êý
Àý
3£º°ü×°Ïà¹ØµÄ¹¦ÄÜ
ÆäËûÀý×Ó
ÒâÍâµÄ±Õ°ü
Internet Explorer
µÄÄÚ´æй©ÎÊÌâ
¼ò½é
·µ»ØĿ¼
Closure
Ëùν“±Õ°ü”£¬Ö¸µÄÊÇÒ»¸öÓµÓÐÐí¶à±äÁ¿ºÍ°ó¶¨ÁËÕâЩ±äÁ¿µÄ»·¾³µÄ±í´ïʽ£¨Í¨³£ÊÇÒ»¸öº¯Êý£©£¬Òò¶øÕâЩ±äÁ¿Ò²ÊǸñí´ïʽµÄÒ»²¿·Ö¡£
“±Õ°ü”ÊÇÒ»¸ö±í´ïʽ£¨Ò»°ãÊǺ¯Êý£©£¬Ëü¾ßÓÐ×ÔÓɱäÁ¿ÒÔ¼°°ó¶¨ÕâЩ±äÁ¿µÄ»·¾³£¨¸Ã»·¾³“·â±ÕÁË”Õâ¸ö±í´ïʽ£©¡£
£¨±Õ°ü£¬¾ÍÊÇ·â±ÕÁËÍⲿº¯Êý×÷ÓÃÓòÖбäÁ¿µÄÄÚ²¿º¯Êý¡£µ«ÊÇ£¬Èç¹ûÍⲿº¯Êý²»·µ»ØÕâ¸öÄÚ²¿º¯Êý£¬±Õ°üµÄÌØÐÔÎÞ·¨ÏÔÏÖ¡£Èç¹ûÍⲿº¯Êý·µ»ØÕâ¸öÄÚ²¿º¯Êý£¬ÄÇô·µ»ØµÄÄÚ²¿º¯Êý¾Í³ÉÁËÃû¸±ÆäʵµÄ±Õ°ü¡£´Ëʱ£¬±Õ°ü·â±ÕµÄÍⲿ±äÁ¿¾ÍÊÇ×ÔÓɱäÁ¿£¬¶øÓÉÓÚ¸Ã×ÔÓɱäÁ¿´æÔÚ£¬Íⲿº¯Êý¼´±ã·µ»Ø£¬ÆäÕ¼ÓõÄÄÚ´æÒ²µÃ²»µ½ÊÍ·Å¡£——ÒëÕß×¢£¬2010Äê4ÔÂ3ÈÕ£©
±Õ°üÊÇ ECMAScript
£¨JavaScript£©×îÇ¿´óµÄÌØÐÔÖ®Ò»£¬µ«ÓúñհüµÄÇ°ÌáÊDZØÐëÀí½â±Õ°ü¡£±Õ°üµÄ´´½¨Ïà¶ÔÈÝÒ×£¬ÈËÃÇÉõÖÁ»áÔÚ²»¾Òâ¼ä´´½¨±Õ°ü£¬µ«ÕâЩÎÞÒâ´´½¨µÄ±Õ°üÈ´´æÔÚDZÔÚµÄΣº¦£¬ÓÈÆäÊÇÔڱȽϳ£¼ûµÄä¯ÀÀÆ÷»·¾³Ï¡£Èç¹ûÏëÒªÑﳤ±Ü¶ÌµØʹÓñհüÕâÒ»ÌØÐÔ£¬Ôò±ØÐëÁ˽âËüÃǵŤ×÷»úÖÆ¡£¶ø±Õ°ü¹¤×÷»úÖƵÄʵÏֺܴó³Ì¶ÈÉÏÓÐÀµÓÚ±êʶ·û£¨»òÕß˵¶ÔÏóÊôÐÔ£©½âÎö¹ý³ÌÖÐ×÷ÓÃÓòµÄ½ÇÉ«¡£
¹ØÓÚ±Õ°ü£¬×î¼òµ¥µÄÃèÊö¾ÍÊÇ ECMAScript
ÔÊÐíʹÓÃÄÚ²¿º¯Êý££¼´º¯Êý¶¨Ò
Ïà¹ØÎĵµ£º
<html>
<head>
<script type="text/javascript">
function tree(treethis){
if (treethis.alt == "+"){
treethis.alt = "-";
document.getElementById("bench").style. ......
8¡¢Ext.jsµÄдÀ෽ʽ
ÕâÀïÓõÄÊÇExt core3.0£¬ExtÖÐÓÃExt.extendÀ´¶¨ÒåÒ»¸öÀࣨµ±È»Ëü¸ü¶àÓÃÀ´À©Õ¹Ò»¸öÀࣩ£¬ExtÕû¸ö¿ò¼Ü¸÷ÖֿؼþÈçPanel£¬MessageBoxµÈ¶¼ÊÇÓÃExt.extend·½·¨À´À©Õ¹¡£ÕâÀï½ö½öÓÃËüÀ´¶¨ÒåÒ»¸ö×î¼òµ¥µÄÀà¡£
¿´Ext.extendµÄ´úÂë¿ÉµÃÖª£¬ËüÈÔÈ»ÊÇÓù¹Ô캯ÊýºÍÔÐÍÀ´×é×°Ò»¸öÀà¡£
ÕâÀïÖ»Ðè´«Á½¸ö²ÎÊý¼´¿É£¬µÚÒ ......
10¡¢mootools.jsµÄдÀ෽ʽ
mootools.jsµÄ×îа汾ÊÇ1.2.3,ÕâÀïʹÓõÄÊÇ1.2.0¡£mootool±»Éè¼Æ³É·Ç³£½ô´ÕµÄ£¬Ä£¿é»¯µÄ£¬ÃæÏò¶ÔÏóµÄµÄjs¿â¡£mootoolÖÐдÀàÓÃClassÀà¡£ClassÀàÓÉNativeÀànew³öÀ´µÄ£º
/*
*Script: Class.js
*/
var Class = new Native({
name: 'Class',
initialize: function(properties){
propert ......
1 ¿ò¼Ü±à³Ì¸ÅÊö
Ò»¸öHtml Ò³Ãæ¿ÉÒÔÓÐÒ»¸ö»ò¶à¸ö×Ó¿ò¼Ü£¬ÕâЩ×Ó¿ò¼ÜÒÔ<iframe>À´±ê¼Ç£¬ÓÃÀ´ÏÔʾһ
¸ö¶ÀÁ¢µÄHtml Ò³Ãæ¡£ÕâÀïËù½²µÄ¿ò¼Ü±à³Ì°üÀ¨¿ò¼ÜµÄ×ÔÎÒ¿ØÖÆÒÔ¼°¿ò¼ÜÖ®¼äµÄ»¥Ïà·ÃÎÊ£¬
ÀýÈç´ÓÒ»¸ö¿ò¼ÜÖÐÒýÓÃÁíÒ»¸ö¿ò¼ÜÖеÄJavaScript±äÁ¿¡¢µ÷ÓÃÆäËû¿ò¼ÜÄڵĺ¯Êý¡¢¿ØÖÆÁíÒ»
¸ö¿ò¼ÜÖÐ±íµ¥µÄÐÐΪµ ......
×Ö·ûÊǼÆËã»úÈí¼þ´¦ÀíÎÄ×Öʱ×î»ù±¾µÄµ¥Î»£¬¿ÉÄÜÊÇ×Öĸ£¬Êý×Ö£¬±êµã·ûºÅ£¬¿Õ¸ñ£¬»»Ðзû£¬ºº×ֵȵȡ£×Ö·û´®ÊÇ0¸ö»ò¸ü¶à¸ö×Ö·ûµÄÐòÁС£Îı¾Ò²¾ÍÊÇÎÄ×Ö£¬×Ö·û´®¡£ËµÄ³¸ö×Ö·û´®Æ¥Åäij¸öÕýÔò±í´ïʽ£¬Í¨³£ÊÇÖ¸Õâ¸ö×Ö·û´®ÀïÓÐÒ»²¿·Ö£¨»ò¼¸²¿·Ö·Ö±ð£©ÄÜÂú×ã±í´ïʽ¸ø³öµÄÌõ¼þ¡£
......