LAB.js
åã®æãèªã¿ã¸ã®ã³ã¡ã³ãã§id:edvakfãããè¨åãã¦ãjsã©ã¤ãã©ãªã
- jsã¨ä»ã®ã³ã³ãã¼ãã³ãï¼ä»ã®jsãcssãimgãetc.ï¼ã®ä¸¦è¡DL
- ifameè¦ç´ ã¯ï¼ä»åº¦èª¿ã¹ã
- è¤æ°jséã®ä¾åé¢ä¿ç¶æ
- ã¯ãã¹ãã©ã¦ã¶
- jQueryã©ã¤ã¯ãªã¡ã½ãããã§ã¼ã³ã§æ¸ããããã³ã¼ã
- æ»ãå¤ã¯$LAVãªãã¸ã§ã¯ã
- è¦æ³¨æãã¤ã³ãã¯ãjQueryã¯1.4以ä¸ã«ãã¨ãã
- å®ããªãã¨Fxã§å¤§å¤ãªç®ã«ã»ã»ã»
LABjs
åå¨ã¯ç¥ã£ã¦ããããç¥ããªãã¨ããç¶æ ã ã£ãã®ã§ãããæ©ã«æãèªã¿ã
以ä¸æãèªãã å 容ï¼homeãdescriptionãrelease notes
- LABã¯Loading And Blockingã®ç¥
- MITã©ã¤ã»ã³ã¹
- Getify Solutionsï¼Kyle Simpsonï¼ã®ããã¸ã§ã¯ã
- Steve Soudersã¨ã®ã³ã©ããããã¨ãæ´»ãããã¦ã
LABjs & User-Experience
- jsã®åæãã¼ã
- ããã¼ã¯ãjsã¯1åãã¤ãããã¼ããããªã
- jsã¨ä»ã®ã³ã³ãã¼ãã³ãã®åæãã¼ãï¼ex.js/css/imgã®åæãã¼ãï¼
- ããã¼ã¯ãjsãã¼ãã¯ä»ã®ã³ã³ãã¼ãã³ãã®ãã¼ãããããã¯ãã
- è¤æ°jséã®ä¾åé¢ä¿ãç¶æã§ãã
- ããã¼ã¯ãscriptè¦ç´ ãæ¸ãé çªã§ä¾åé¢ä¿ãæå®ï¼ex.jquery.jsã¯ä¸çªä¸ã«ï¼
- ãã¼ã¸ãã¼ãé«éåã¯ãã¦ã§ãéçºè
ã«èª²é¡ãåºãã¦ãã:FUBCåé¡
- ãã¼ã¸ã³ã³ãã³ãã¸jsãå®è¡ãããåã«ã¦ã¼ã¶ã¯ç»é¢ãæä½ãå§ããå¯è½æ§ãåºã¦ãã
- FOUCï¼flash of un-styled contentï¼ãªãã¬FUBC(flash of un-behaviored content)
- ï¼åæã«è£è¶³ï¼ãªã³ã¯å ããããã¢ããããããã¢ã³ã«ã¼ã«ã¤ãã³ããã»ããããåã«ã¦ã¼ã¶ãã¯ãªãã¯ãã¦ãã¾ããã¨ãã¨ã
- LAB.jsã¯progressive enhancementã«ãããããã¦ãããprogressiveãªé¨åãã¦ã¼ã¶ã«å¯¾ãã¦ãæ確ã«ãã¶ã¤ã³ããªãã¨ãããªã
- FUBCåé¡ã¸ã®å¯¾å¦ä¾
- jså®è¡ã«ãã£ã¦å¤§ããåã¬ã³ããªã³ã°ãããç®æã¯ãjså®è¡çµäºã¾ã§cssã§é表示ã«
- ã³ã³ãã³ãã®è¡¨ç¤ºãjsã«ãã£ã¦æä½ããã¨ãã¯ãã³ã³ãã³ãã表示ããã¦ãï¼ããªããææ¡ãã
- jsé対å¿ã¦ã¼ã¶ã¸ã®é æ ®ãnoscriptè¦ç´ ã§ä»£æ¿è¦ç´ ãç¨æ
æçãªã¾ã¨ãï¼/description.phpï¼
- 軽éï¼minifiedçã4.5kãgzipããã°2.1kã«ï¼
- çã
- jsãã¼ãã¨ä»ã®ã³ã³ãã¼ãã³ãã®ãã¼ãã並è¡ããããã¨
- 競åãã¼ãã¼ç³»jsã©ã¤ãã©ãªã¨åãæ©è½
- å·®å¥å
- è¤æ°jséã®ä¾åé¢ä¿ãç¶æã§ãã
-
- 競åjsã©ã¤ãã©ãªãèºãã¦ããã«ã³ã¿ã³ã«ã§ãã¦ããªãã¨ããã
-
- é 延å®è¡ãã§ãã
- è¤æ°jséã®ä¾åé¢ä¿ãç¶æã§ãã
- è¤æ°jséã®ä¾åé¢ä¿ãç¶æããããã¾ããªãããæ¹
- ãã¼ããçµãã£ããã³ã¼ã«ããã¯ãç£è¦å´ã«éã£ã¦å®è¡é çªã管ç
- ã³ã¼ãã£ã³ã°è¦ç´ã¨ãã¦ç´æãã¨ã¨ãã¦jsã«ã³ã¡ã³ããæ¸ããããã
- loadã¤ãã³ããscriptè¦ç´ ãã¨ã«ã»ãããã
- ãæåã«ï¼ã¤js並åãã¼ããã¦ãããï¼ã¤jsããã¼ãï¼å®è¡ãã®ãããªã±ã¼ã¹
- ä¸è¨ãã¾ããªãããæ¹ã§ã¯ã対å¿ãè¤éã«ãªã
- å ¨ã¦ã®jsã®ãã¼ãã®ç¶æ³ãææ¡ãã¦è¨è¨ããªãã¨ãããªãããã
- ããã§LAB.js
- å®è¡ãé çªã«ããã®ãé çªãåããªãã®ããã«ã³ã¿ã³ã«æå®ã§ãã
- ã¡ã½ãããã§ã¼ã³ã§æ¸ãããã
LAB.jsã®ä½¿ãæï¼/description.phpï¼
- å§ç¸®(minifyï¼ãããè¤æ°jsåä½ï¼contatï¼ã¨ããã½ãªã¥ã¼ã·ã§ã³ã¸ã®ä»£æ¡ã§ã¯ãªã
- ä½µç¨ã§ããããã¹ãã
- httpãªã¯ã¨ã¹ããåºæ¥ãã ãæ¸ããã¹ããã ãã
- jsï¼ãã¡ã¤ã«ã«åºããã¨ããLab.jsã¯åºçªããï¼
- åºçªãããã使ãã°ãã¼ãæééããªã
- jsã®ãã¼ãä»ã®ã³ã³ãã¼ãã³ãã¨ã®ä¸¦åãã¼ããLAB.jsã§ã§ãããã
- CDNãªã©ã使ã£ã¦è¤æ°ã®ãµã¼ãã¼ã«ãã¡ã¤ã«ãåæ£ãã¦ããµã¤ããå¤ã
- ãã®å ´åãLAB.jsã¯ãã¾ããã¼ããã¦ããã
- CDNã«ã¢ããããã¦ãjqueryããã¼ãã§ããªãã¨ãã¯å¥ãµã¼ãã¼ãããã¼ãã«åãæ¿ããã¨ã
- ãã®å ´åãLAB.jsã¯ãã¾ããã¼ããã¦ããã
- jsåä½ããã ããããã¡ãªã®ï¼ã®è©³ãã話ã¯ããã°ã«ã¨ã³ããªæ¸ãããèªãã
LABjsã使ãã¹ããããªãã±ã¼ã¹
- document.write()ã¨ä½µç¨ãããªããLAB.jsã¯ä½¿ãã¹ããããªã
- document.write()ã¯åæçãéåæãã¼ããã¯ããã¯ã§ããLAB.jsã¨éé
- DOMããªã¼æ§ç¯ãæ¤ç¥ããã¹ã¯ãªããã¨LAB.jsãä¸å
·åã«èµ·ããã¨ããLAB.jsã¯ä½¿ãã¹ããããªã
- DomContentLoadedï¼or代æ¿ã¤ãã³ãï¼çºç«å¾ã«DOMããªã¼æ§ç¯ãæ¤ç¥ããã¹ã¯ãªãããLAB.jsçµç±ã§èªã¿è¾¼ãã ã¨ããæ¤ç¥ã¹ã¯ãªãããDomContentLoadedãæ°¸é ã«å¾
ã¡ç¶ããå ´åããã©ã¦ã¶ã«ãã£ã¦ã¯èµ·ããã---ä¾ãã°1.4以åã®jQueryã¨Fx3.5ã®çµã¿åããã®å ´åã
- jqueryãã¼ã å´ã§ãã°ã¨ãã¦ç»é²ããã1.4ã§è§£æ±ºãããï¼{34} jQuery 1.4 Closed Bugs - jQuery - Developmentï¼ã
- 詳ããã¯ã¨ã³ããªæ¸ãããèªãã
- DomContentLoadedï¼or代æ¿ã¤ãã³ãï¼çºç«å¾ã«DOMããªã¼æ§ç¯ãæ¤ç¥ããã¹ã¯ãªãããLAB.jsçµç±ã§èªã¿è¾¼ãã ã¨ããæ¤ç¥ã¹ã¯ãªãããDomContentLoadedãæ°¸é ã«å¾
ã¡ç¶ããå ´åããã©ã¦ã¶ã«ãã£ã¦ã¯èµ·ããã---ä¾ãã°1.4以åã®jQueryã¨Fx3.5ã®çµã¿åããã®å ´åã
ãªãªã¼ã¹ãã¼ãï¼/releasenotes.phpï¼
- 1.0.2rc1
- IEãã°å¯¾ç
- headè¦ç´ ã¸ã®scriptè¦ç´ æ¿å ¥æ¹æ³ãappendChildããinsertBeforeã«å¤æ´
- ãã¼ããªã¹ãæ´æ°å¨ãã§ã®ãã°ãç´ããã
- script[rel]å»æ¢
- ããªãã¼ããããscriptè¦ç´ ã¸relå±æ§ä½¿ãã®æ¢ãã
- ããªãã¼ããããscriptè¦ç´ ã®mimetypeå¤æ´
- ãtext/htmããããscript/cacheãã¸
- ãã°ã»é害fixè²ã
- IEãã°å¯¾ç
- 1.0.1
- ããã
- wait()使ããã«script()使ã£ãã¨ãã«ãã¡ã½ãããã§ã¼ã³ãæå¾ã¾ã§è¾¿ãããªããã°ç´ãã
- 1.0
- æ£å¼ãªãªã¼ã¹ãminifyãã¦4.5kãgzipããã°2.1k
- 1.0rc5
- ãã¡ã¤ã«ãµã¤ãºæé©å
- XHRã®ç£è¦æ¹æ³å¤æ´
- setInterval()ããoneadystatechangeã¸
- 1.0rc4
- Fx3.6以åéå®ï¼ï¼ï¼ã®ããã¯ã追å
- Andrea Giammarchiã®ãã¯ããã¯ï¼195 Chars To Help Lazy Loadingï¼ã使ã£ã
- Fx3.6以åéå®ï¼ï¼ï¼ã®ããã¯ã追å
- Andrea Giammarchiã®ããã¯ã«ã¤ãã¦
- Fx3.5以ä¸ã§ä»æ§ã©ããdocument.readyStateãå¾ããã
- jQuery1.3.2以éã¯ãã®ãããã«ãã£ã¦LAB.jsçµç±ã§ã®ãã¼ãã«å¯¾å¿ã
- document.readyState
- HTML5ã®ã¹ããã¯ã«ãå ¥ã£ã
- IEã§ã¯æããå®è£ æ¸
- Fxã¯3.6ã§ãã°ä¿®æ£ãããï¼document.readystate="complete"ã®ãµãã¼ãï¼
- 1.0rc3
- fLABjsãLAB.jsã«çµã¿è¾¼ã¿
- fLABjsã¯fileã¹ãã¼ã ï¼file://ï¼ã«å¯¾å¿
- ãã°fixããã¡ã¤ã«ãµã¤ãºæé©åãè²ã ã¨
- fLABjsãLAB.jsã«çµã¿è¾¼ã¿
- 1.0rc2
- ãã©ã¦ã¶æ¤ç¥æ¹æ³ãå¤ãã
- ããã©ã¼ãã³ã¹ã¢ãã
- 1.0rc1
- ããªãã¼ãæ©è½ã§API追å
- 0.9
- ãã¡ã¤ã«ãµã¤ãºè»½éåã2.1kã«
- ã©ã³ã¿ã¤ã å®è¡ã®å¹çã¢ãã
以ä¸æãèªãã å 容ï¼documentation
ãã¹ãçµæï¼/documentation.phpï¼
- Win
- IE6-7
- Fx1.5ã3.6rc1
- Chrome4
- Opera9.6ã10
- Safari4
- ç¥
- Mac
- Safari3.2.4
- Netscape9
- Fx1.5ã3.5
- Opera9.6ã10
- ç¥
- Linux
- Fx1.5, 2, 3.5
- Opera9.5,9.6,10
- Netscape9
é対å¿ãã©ã¦ã¶
æ¸ãæ¹ä¾ãããã
ãããªã
ä¸è¨ã³ã¼ã解説
- js4ãã¡ã¤ã«åæã«ãã¼ããããï¼ãããããã©ã«ãï¼
- ï¼çªä¸ï¼framework.jsï¼ã¨ï¼çªç®ï¼plugin.framework.jsï¼ã»ï¼çªç®ï¼myplugin.framework.jsï¼ã¯ä¾åé¢ä¿ããããplugin.framework.jsã¨myplugin.framework.jsã¯ä¾åé¢ä¿ç¡ã
- ï¼çªç®ï¼init.jsï¼ã¯ä¸ï¼ã¤ã¨ä¾åé¢ä¿ã«ãã
- ä¸è¨ã³ã¼ãã§ã¯ï¼ã¤ã®jsã®ä¾åé¢ä¿ãç¶æããã¾ã¾ãframework.jsãæåã«å®è¡ã次ã«plugin.framework.jsã¨myplugin.framework.jsãå®è¡ãæå¾ã«init.jsãå®è¡ããã
$LAB.script()ã«ã¤ãã¦è£è¶³
- scipt()ã«è¤æ°jsãã¡ã¤ã«ã®ãã¼ããæå®ã§ãããé å使ã
- script()ã«src/typeå±æ§ãæå®ãã¦ãã¼ããã§ããããªãã¸ã§ã¯ããªãã©ã«ä½¿ã
$LAB.script({ src: "script1.js", type: "text/javascript" } $LAB.script("script1.js", "script2.js", "script3.js")
LAB.jsã¨ã¤ã³ã©ã¤ã³ã¹ã¯ãªãããçµã¿åããã
- script()ã§ãã¼ããããã©ã¤ãã©ãªï¼ãã©ã°ã¤ã³ç¨ã®åæåã³ã¼ããæ¸ãå ´æ
- LAB.jsã¨LAB.jsãå©ç¨ãã¦ããscriptè¦ç´ ã®ä¸ã«ãã¼ãããã©ã¤ãã©ãªï¼ãã©ã°ã¤ã³ç¨ã®ã³ã¼ãæ¸ããscriptè¦ç´ ãç½®ãã¦ããundefinedã«ãªã
- $LABã®æåã®ã¡ã½ãããã§ã¼ã³ãå®è¡ãããããã¡ã½ãããã§ã¼ã³ã®æå¾ã¾ã§å®è¡ãããã®ãå¾ ããã«ãç´ä¸ã®scriptè¦ç´ ã«æ¸ãããã³ã¼ããå®è¡ããã¦ãã¾ã
- ä¾åé¢ä¿ç¶æãããªããLab.jsã®ã¡ã½ãããã§ã¼ã³ã®ä¸ã«åæåã³ã¼ãã®ãå®å
¨ã
- wait()ã¡ã½ãã使ãããåæåã³ã¼ããfunctionã§ã©ãããã¦ããã()ã«å ¥ãã¦å¼ã¨ãã¦wait()ã«æ¸¡ã
LAB.jså°å ¥ã®ã³ã
- æ¢åã®htmlå ã®jsããã¼ããã¦ãscriptè¦ç´ ãï¼ã¤ãã¤ãscript()ã¡ã½ããã«ç½®ãæãã
- ã¤ã³ã©ã¤ã³ã®ã¹ã¯ãªããã¯ã.wait(function(){ ... })ãã«ã©ãããã¦ããããã
LAB.jsã®ç¹å¥ãªæ©è½
- ãã©ã¦ã¶æ¤ç¥
- ãªãã¸ã§ã¯ãæ¤ç¥ï¼ex.if(ActiveXObject)ï¼ã§ã¯å¯¾å¿ã§ããªãã¨ãç¨
//operaç¨ãif(is_opera)ã»ã»ã¨ä½¿ã is_opera = window.opera && Object.toString.call(window.opera) == "[object Opera]" //geckoç¨ãgeckoã®ã¿trueãè¿ããif(is_geckoï¼ã»ã»ã¨ä½¿ã is_gecko = (function(o) { o[o] = o+""; return o[o] != o+""; })(new String("__count__"))
LABjs API
- ã¡ã½ããã¯ï¼ã¤
- $LAB.setGlobalDefaults()
- $LAB.setOptions()
- $LAB.script()
- $LAB.wait()
- ããã°å·¡åãã¦ã¦è¦ããã.block()ã¯å»æ¢ããããããï¼LAB.src.jsã®337è¡ç®ãããï¼
global.$LAB.block = global.$LAB.wait; // alias "block" to "wait" -- "block" is now deprecated
.setGlobalDefaults()ã¨.setOptions()
- ããã©ã«ãã®è¨å®ãå¤ãããã¨ãã«ä½¿ã
- å¼æ°ã¯ãªãã¸ã§ã¯ããªãã©ã«ã®å½¢å¼ã§æ¸¡ã
- .setGlobalDefaults()ã¨.setOptions()ã®éã
- .setGlobalDefaults()ã¯ãã§ã¼ã³ã§ããªãããã¼ã¸å ¨ä½ã®è¨å®ã«ãªã
- .setOptions()ã¯ãã§ã¼ã³ã§ããããã¡ã½ãããã§ã¼ã³ã®æåã§ã³ã¼ã«ããã®ãå¿ é
.setGlobalDefaults()ã¨.setOptions()ã§è¨å®ã§ããé ç®
- 以ä¸ã®é ç®ãæå®ããã¨ããã©ã«ãè¨å®ãå¤ããã
- AlwaysPreserveOrder
- ããã©ã«ãã¯false
- script()ã§ãã¼ãããjsã®å®è¡é çªãæå®ãããã¨ãã«ã
- ãªã³ï¼trueï¼ã«ããã¨ãã¡ã½ãããã§ã¼ã³ã§ã¤ãªãã é çªã«å®è¡ããã
- ãã¨ã§ãã
- UsePreloading
- ããã©ã«ãã¯true
- ããªãã¼ãï¼â å®è¡ï¼ããããã©ãã
- ãªã³ï¼trueï¼ã®ã¨ãã¯ãLAB.jsãå®è£ ãã¦ã並è¡ï¼¤ï¼¬ã®ãã¯ããã¯ãæ大éå©ç¨ããã
- ãªãã«ããã¨ãã¡ã½ãããã§ã¼ã³ã«è¿½å ããã¹ããããã¨ã«é çªã«ãã¼ãï¼å®è¡ãããã
- UseLocalXHR
- ããã©ã«ãã¯true
- ãªã³ï¼trueï¼ã®ã¨ãã¯XHR使ã£ã¦ãã¼ã«ã«ã®ãã¡ã¤ã«ããã¼ãããã
- ãã£ãã·ã¥ãèªã¿ã«è¡ãã®ã¨ã»ã¼å義ï¼ããã¦ãã®ãã©ã¦ã¶ã§ã¯ï¼
- Fx/Operaã§ã¯ãã®ãã¯ããã¯ã¯ä½¿ããªãã®ã§ç¡è¦ããã
- UseCachePreload
- ããã©ã«ãã¯true
- LAB.jsã«ããã¦ãtext/html cachingãã¨å¼ã°ãããã¯ããã¯ãå©ç¨ãããã©ãããå¤å®
- ãtext/html cachingã
- é 延å®è¡ã®ããã«jsãtext/htmlã¨ãã¦ãã¼ãããã¨ããã
- åé¡ã¯ãmime typeãæ£ãããªãã®ã§ãå®è¡ã§ããªãã¨ããã±ã¼ã¹ãçºçãã
- ãã®åé¡ãåé¿ããããã«ãLAB.jsã§ã¯ãã¼ãæã¯text/htmlãæå®ããã¡ã½ãããã§ã¼ã³ãããã¼ãããjsãå©ç¨ããã¹ãããã«å°éããã¨ãã«ãå度scriptè¦ç´ ããªã³ã¶ãã©ã¤ã§çæããæ£ããmmeme typeï¼text/javascriptï¼ãæå®ãã¦ãå®è¡ã§ããããã«ãã¦ãã
- AllowDuplicates
- ããã©ã«ãã¯true
- ãã¨ã§ãã
- AppendTo
- ãªã³ã¶ãã©ã¤ã§çæããscriptè¦ç´ ã®æ¿å ¥ä½ç½®ãããã
- ããã©ã«ãã¯head
- bodyãheadããé¸ã¹ã
- BasePath
- ããã©ã«ãã¯""ï¼æå®ãªãï¼
- ãã¨ã§ãã
.script()ã¨.wait()
ãã¨ã§ãã