jQuery is a fantastic library but it needs to stay lean and small by providing only the most commonly need features. However there are many other little utilities that I have used frequently enough and found myself always rewriting them, so I started collecting them into a little library. Many of these are just little shortcuts to code I find myself constantly typing out, but don't think of it as
â» phiary ã«å¼ã£è¶ãã¾ãã. æ¯æ¥ããã°ã©ãã³ã°ãWebã«é¢ããæ å ±ãçºä¿¡ãã¦ãã¾ã! RSS ç»é²ãã¦ãã¾ã«è¦ããã, tweet ãããããã¦æ¡æ£ãã¦ããããã¨å¹¸ãã§ã. enchant.js ææ¶ã® 100 tips!! ãã¼ã«ã«æ´çãã¦ããæåå¼·ãã¦ãä½ã£ã enchant.js ã®ãµã³ãã«ã大éã«åºã¦ããã®ã§, æ´çããã¤ãã§ã«å ¬éãããã¨æãã¾ã. æçµçã« 100è¶ ãã¡ãã£ããã©w(å ¨é¨ã§102åããã¾ã) éå¼ãã¦ããªæãã§ã¾ã¨ãã¦ã¾ã. åèã«ãªãã°å¹¸ãã§ã. å ¨ã¦ jsdo.it ã«ç§»æ¤ããã®ã§ Webä¸ã§å®è¡ã§ãã¾ã!! fork ãªããã¦ã³ãã¼ããªããã¦éãã§ãã ãããªâªâª Tips Base(åºæ¬) åºç¤ã§ã. enchant.js ã®ãã³ãã¬ã¼ããç¨æããã Entity(ã¨ã³ãã£ãã£) 表示ç©ç³»ã®åºåºã¯ã©ã¹ã§ã. å é¨ã§ DOM ãæã£ã¦ããã®ã§è¡¨ç¤ºã¯
Introduction Writing a best practice article is quite a tricky business. To a number of you, what you are about to read will appear to be very obvious and just the sensible thing to do. However, looking around the web and getting code handed over to me from other developers for years has taught me that common sense is actually quite a rarity in live code on the web, and the âsensible and logical t
ãã©ã°ã¤ã³ã ãã©å ¬éãã¦ãªããã®ã ã£ããããã¤ã使ã£ã¦ããã©ã°ã¤ã³ã¨ã®çµã¿åããã ã£ãããã·ã§ã¼ãã³ã¼ãã¨ããªãã ãè²ã ãã©ããCodaã«ã¹ããããã§ç»é²ãã¦ã¦ä¸çºå¤æã§ä½¿ã£ã¦ã¾ãã ã³ã¼ãã¯ã¢ã¬ãªãã§ããã©ãã²ãã£ã¨ãã¦ã²ãã£ã¨ããã¨èª°ãã®å½¹ã«ç«ã¤ãããããªãã®ã§æ¥ããããªããå ¬éãã¾ãã対象ã¯ã¡ãã£ã¨ã ãJSæ¸ããã¨ããããã人ã§ããããã¶ããæ¸ãã人ã¯ãã£ã¨ãã¬ã¤ãªãã¤ä½¿ã£ã¦ãã§ãããããï¼ãã£ã¨ãããã«æ¸ãã¨ãä½ãã®ã³ã¼ãã¨ããæè¿ï¼ ç´¹ä»ãã¦ãã¹ãããããã¡ ãã¼ã¸ãããã«ã¹ã¯ãã¼ã«ããã ã ããã¹ãããã¯ã¹ã«ã©ãã«è¡¨ç¤ºããã㤠è¦ç´ ã®ãµã¤ãºãåå¾ããã㤠ã¿ããããããã㤠IEã§éépngããã§ã¼ãããã¨ãã«é»ããªããã¤å¯¾çã®show()ã¨hide() Google Analyticsã®ãã©ãã¯ã¤ãã³ã䏿¬bind Ajaxãµã¤ãã«ããã¨ãã«ä½¿ããªã³ã¯ç½®ãæããã©ã°ã¤ã³ ã¹ã¯
14ã®jQueryãã¹ããã©ã¯ãã£ã¹ åæ:14 Helpful jQuery Tricks, Notes, and Best Practices è¯ãã£ãã®ã§ç¿»è¨³ãã¦ã¿ã¾ãããããªãã®æè¨³ã§ã䏿ã«è¨³ãã¦ãªãç®æãå¤ãã®ã§è©³ããã¯åæãåç §ãã¦ãã ããã 1.ã¡ã½ããã¯jQueryãªãã¸ã§ã¯ããè¿ã ã»ã¨ãã©ã®ã¡ã½ãããjQueryãªãã¸ã§ã¯ããè¿ãã®ãéè¦ã§ãã ããã«ããæ¬¡ã®ãããªã¡ã½ãããã§ã¼ã³ãå¯è½ã«ãªã£ã¦ãã¾ãã $someDiv .attr('class', 'someClass') .hide() .html('new stuff'); jQueryãªãã¸ã§ã¯ããè¿ãã®ãããã£ã¦ããã°æ¬¡ã®ããã«åå²ãã¦æ¸ããã¨ãåºæ¥ã¾ãã var someDiv = $('#someDiv'); someDiv.hide(); 次ã®ããã«ä¸è¡ã§æ¸ããã¨ãåºæ¥ã¾ãã var someDiv
ããã«ã¡ã¯ãéçºé¨ã§ã¤ã³ã¿ã¼ãã§ã¼ã¹ã¨ã³ã¸ãã¢ããã£ã¦ããã¾ãæ²¹äº(ãã¶ã)ã§ããã©ã¤ããã¢ã§ã¯ä¸»ã«javascriptãä¸å¿ã¨ããã¯ã©ã¤ã¢ã³ããµã¤ãå´ã®éçºããã£ã¦ããã¾ãã ä»åã¯è£jQueryã¨é¡ãã¾ãã¦ãæ®æ®µããåã«ã¦ã¼ã¶ã¼ã¨ãã¦ä½¿ã£ã¦ããã ãã§ã¯æ±ºãã¦ç¥ããã¨ãã§ããªãjQueryã®è£æãç´¹ä»ãããã¨æãã¾ãã æ³¨æ ãã®è¨äºã§æ±ãjQueryã¯ææ°çã®1.4ã§åãããã¨ãåæã¨ãã¦ãã¾ã(ä¸ã¤åã®ãã¼ã¸ã§ã³ã§ãã1.3.2ã§ãåããã¨ã¯æ¤è¨¼æ¸ã¿ã§ã)ããµã³ãã«ã§ä½¿ãjQueryã»ã¬ã¯ã¿ã®æ¸ãæ¹ã¯ãjQueryãã§çµ±ä¸ãã¦ãã¾ããã$ãã«ç½®ãæãã¦èªãã§ããã£ã¦ããã¾ãã¾ããã ã¯ããã« - jQueryã§æ±ãã¤ãã³ããããªã¬ã¼ javascriptããµãã ãã«ä½¿ãããç»é¢é·ç§»ã®çºçããªãã¦ã§ãã¢ããªã±ã¼ã·ã§ã³ã§ã¯ãã©ã¦ã¶ä¸ã§çºçããã¤ãã³ããããªã¬ã¼ããã¾ãæ±ãããªãã¨ãããã¨
jQueryãè¯ããã25ã®TIPS ãã¿å ï¼Improve your jQuery - 25 excellent tips ã¡ãã£ã¨å¤ãã§ãããããªãè¯ãTIPSãã¾ã¨ã¾ã£ã¦ãã¾ãã Google AJAX Libraries APIãå©ç¨ããã Google AJAX Libraries APIãæ´»ç¨ããã°ãã°ããã©ã¤ãã©ãªãèªã¿è¾¼ããã¨ãåºæ¥ã¾ãã <script src="http://www.google.com/jsapi"></script> <script type="text/javascript"> // Load jQuery google.load("jquery", "1.2.6"); google.setOnLoadCallback(function() { // Your code goes here. }); </script> ç´æ¥èªã¿è¾¼ããã¨ãåºæ¥ã¾ãã
2010/09/26(æ¥) ã«äº¬é½ã§ Kanasan.JS jQuery ã³ã¼ããªã¼ãã£ã³ã° #2 ãè¡ããã(åç¥ãã¼ã¸)ãã¿ããªã§ jQuery ã®ã½ã¼ã¹ã³ã¼ããèªãã¤ãã³ãã§ãä»åã2åç®ã ãåå è åéä¸ã§ãã jQuery ã¯ãã¡ã¤ã«1ã¤ã ãã®ã©ã¤ãã©ãªãªã®ã§ãããç°å¢ã¨ããã£ã¦ãªãã¦ã大ä¸å¤«ãªãã ãã©ãèªãããã§åèã«ãªããµã¤ãã¨ããã¾ã¨ãã¦ã¿ãããã®è¾ºã®æºåããã¦ããã¨çè§£ãæ·±ã¾ãã¨æãã ã½ã¼ã¹ã³ã¼ã http://code.jquery.com/jquery-1.4.2.js http://github.com/jquery/jquery ã¾ã㯠jQuery ã®ã½ã¼ã¹ã³ã¼ããåã£ã¦ããªãã¨å§ã¾ããªããä»åã¯ãã¼ã¸ã§ã³ 1.4.2 ã使ç¨ãããjQuery ã®å ¬å¼ãµã¤ãããå§ç¸®ãã¦ããªãã³ã¼ãããã¦ã³ãã¼ããããã ããã¨ãjQuery ã½ã¼ã¹ã³ã¼ã㯠Git ã§ç®¡çããã¦
Twitter ã ã¨ã¡ãã£ã¨å³ããã®ã§ããã£ã¡ã§ã¾ã¨ãã MobileWebKit ã«å¯¾å¿ãããã¨æã£ãããã³ã¼ãããªãã¨ããã¦åãå¿ è¦ãããã¾ãã AND æ¼ç®å ã§ 4byte åã(10byte â 6byte) if (a) { b(); } â a && b(); OR æ¼ç®å ã§ 5byte åã(11byte â 6byte) if (!a) { b(); } â a || b(); ãããæ¼ç®å以éãèªåã§ Minify ãã JavaScriptã¯åçãªè¨èªãªã®ã§ããããæ¼ç®å以éã¯åºæ¬çã« minify ãã¦ãå§ç¸®ããã¾ããã document.createElement("div"); document.createElement("a"); document.createElement("p"); â ãã®ã¾ã¾ã ã¨ãminify ãã¦ã縮ã¾ããªã document.
ä¾ï¼1æ¸ããå ´å Firebugã®consoleã«ä¸ã®ã³ã¼ããã³ãããã¦ã Excelã®è¡¨ãç¯å²é¸æãã¦ã³ãã¼ãããã®ã"ãã"ã£ã¦æ¸ãã¦ããã¨ããã«çªã£è¾¼ãã ã§ãå®è¡ã copy( <> <![CDATA[ ãã ]]> </>.toString().replace(/(\d)-/g,function($0,$1) ($1-1)+"-") );
jQueryã«ããã:first-childã¨:firstã®éã jQueryã«ã¯ã:first-childãã¨ããã»ã¬ã¯ã¿ã¨ã:firstãã¨ããã»ã¬ã¯ã¿ãåå¨ãã¦ãããæ··åãããã¡ã§ããç°ãªãæå³ãæã£ã¦ããã¾ãã ä¾ãã°ã次ã®ãããªHTMLãããã¨ãã¾ãã <ul> <li>list1-1</li> <li>list1-2</li> <li>list1-3</li> <li>list1-4</li> </ul> <ul> <li>list2-1</li> <li>list2-2</li> <li>list2-3</li> <li>list2-4</li> </ul> :first-childã§æå®ã§ããã®ã¯ã<li>list1-1</li>ãã¨ã<li>list2-1</li>ãã§ãã $("li:first-child").css("color","red"); ãµã³ãã« ä¸æ¹:f
Firebugã®consoleã«ä¸ã®ã³ã¼ããã³ãããã¦ã tableä¸è¡åãã³ãã¼ãããã®ã"ãã"ã£ã¦æ¸ãã¦ããã¨ããã«çªã£è¾¼ãã ã§ãå®è¡ã copy( <> ãã </> .toString() .trim() .replace(/\n/g,'') .replace(/\s+/g,',') ); æååã®ä¸ã«XMLã®ã¿ã°ã¨ãã¦è§£éãããã§ããããã®ãå«ã¾ãã¦ããå ´åã¯ããã copy( <> <![CDATA[ ãã ]]> </> .toString() .trim() .replace(/\n/g,'') .replace(/\s+/g,',') );
2010å¹´04æ28æ¥22:00 ã«ãã´ãªLightweight Languages javascript - Array.prototype.slice.apply(arguments) // 弿°ä¸çºé åå ãããªã®ã§ãã⦠細ããJavaScriptã®ä»æ§ãç¿æ £ããã¯é - ä¸çå µ var func = function() { var leng = arguments.length; for(var i = 0, arr = []; i < leng; i++){ arr[i] = arguments[i] * 10; } alert(arr); }; ããæ¸ãã¾ãã var func = function() { var args = Array.prototype.slice.apply(arguments); var arr = args.map(function(n){ r
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}