You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
JavaScriptã§ã¯0ãnullãundefinedããã¹ã¦åãå¤å®ã«ãªããã©åããæ¹æ³ãªãã®ï¼ ã¿ã¤ãã«ã®éãããããªå ´åã©ãããããif (!value)ã¨æ¸ãã¦ãã¾ãã¨ã0ãnullãundefinedã®å ¨é¨ãtrueã¨ãã¦å¤å®ããã¦ãã¾ãã nullãundefinedã ãtrueå¤å®ã«ãããã±ã¼ã¹ããã£ãã®ã§èª¿ã¹ã¦ã¿ãã [JavaScript] null ã¨ã undefined ã¨ã 0 ã¨ã 空æå('') ã¨ã false ã¨ãã®å¤å®ã«ã¤ãã¦ã«å¤§ä½æ¸ãã¦ãããããã®ãããã¯ã®é¨åã ãã¾ã¨ãã¦ã¿ãã TL;DR if (value == null)ã使ãã®ãä¸çªã¹ãã¼ããªæ¸ãæ¹ã®ããã§ãã 1. if (value === undefined || value === null) æç´ã«å¤ãundefinedã¨nullã¨æ¯è¼ããæ¹æ³ã 誰ãè¦ã¦ãåãããããããã©ããé
ã§ããï¼10é²æ°ã®ãæ´æ°ãã¯ãã¹ã¦2é²æ°ã«æ£ããå¤æã§ãã¾ãï¼ JavaScript ã«éããã³ã³ãã¥ã¼ã¿ã¼ã§è¨ç®ãããå ´åã¯ã10é²æ°ãã2é²æ°ã«å¤æãã¦ããè¨ç®ãã¦ãè¨ç®çµæãã¾ã2é²æ°ãã10é²æ°ã«æ»ãã¦è¡¨ç¤ºãã¦ããã¦ãã¾ãã ä¾ãã° 2 + 3 ã¯ãã³ã³ãã¥ã¼ã¿ã¼ã§ã¯æ¬¡ã®ããã«è¨ç®ããã¦ãã¾ããï¼10é²æ°ã2é²æ°ã®å¤ææ¹æ³ã¯ãã®ãã¨èª¬æãã¾ãã®ã§ããªãã¨ãªããããããã®ã ã¨ãç解ãã ããï¼ ã³ã³ãã¥ã¼ã¿ã¼ã10é²æ°ã§è¨ç®ããã°è¯ãããã§ãããã³ã³ãã¥ã¼ã¿ã¼ã¯ãONï¼1ï¼ãã¨ãOFFï¼0ï¼ãã表ãã¹ã¤ããã®ããã¾ãã®ãããªç©ã§ä½ããã¦ãããããã1ãã¨ã0ãã®ã¿ã®2é²æ°ã§è¨ç®ããã»ããé½åãããã®ã§ãã 10é²æ°ã®å°æ°ã2é²æ°ã«æ£ããå¤æã§ããªãçç± ãªã10é²æ°ã®ãå°æ°ãã2é²æ°ã«æ£ããå¤æã§ããªãã®ã§ããããï¼ ããã§ã¯ã¾ã10é²æ°ãã2é²æ°ã¸ã®å¤ææ¹æ³ã確èªãã¦ã¿ã¾ãããã 1
TOPããã°ãµã¤ããéãã¨ãã«ï¼ç»åããµãã£ã¨é 延表示ããããlazysizes.jsããã¬ã¹ãã³ã·ã対å¿ããPageSpeed Insightsæ¹åã ãµã¤ããéãã¨ãã«ï¼ç»åããµãã£ã¨é 延表示ããããlazysizes.jsããã¬ã¹ãã³ã·ã対å¿ããPageSpeed Insightsæ¹åã æ´æ°æ¥ï¼2024/05/24 Webãµã¤ãã®è¡¨ç¤ºé度ãä¸ãããããããã¹ã¯ãã¼ã«ãããã¿ã¤ãã³ã°ã§ç»åãèªã¿è¾¼ããç»åã®é 延表示ããã§ããJavaScriptã¯ããã¤ãããã¨æãã¾ããç§ã試ãããã¨ã¯ããã¾ãããç»åãããã¨åºã¦ãã¦ç»é¢ãã¬ã¿ã¤ããããjQueryãããããªãã¨ã«ã¹ã¿ã ãã«ããã£ããã¨ãæã£ãéãã®åããããæ©ãã§ãã¾ããã ãããªãªãè¦ã¤ãããlazysizes.jsãã¯ããJavaScriptã®èªã¿è¾¼ã¿ãã¨ãã¯ã©ã¹ã®è¿½å ãã ãã§é 延表示ãã§ããç°¡åãªcssã®è¿½è¨ã§ãã§ã¼ãã¤ã³ã§ã®
JavaScriptã§æ£è¦è¡¨ç¾ã®matchã使ãå ´å é常 hoge.match(/abc/); ã¨ãããã©abcã®é¨åã¯å¤æ°ã§ã¯ãªãã¦Stringã¨ãã¦èªèããã¦ãã¾ãã®ã§ var abc = "efg"; hoge.match(/abc/); ã¨ãã¦ãefgãæ¤ç´¢ãã¦ãããªãã ããã§ãå¤æ°ãå ¥ãããå ´åã¯æ£è¦è¡¨ç¾ãªãã¸ã§ã¯ãã使ã var abc = "efg"; reg = new RegExp(abc); hoge.match(reg); ã¨ããã¨efgã§æ¤ç´¢ãã¦ãããããã«ãªãã ç´°ããæ¤ç´¢æ¡ä»¶ãè¨å®å¯è½ reg = new RegExp("^" + abc + "[0-9]+$");
emwaiblog ⺠JavaScript ⺠jQuery ⺠ç»åï¼IMGè¦ç´ ï¼ã®èªã¿è¾¼ã¿å¾ï¼loadã¤ãã³ãï¼ã®å¦çãåããªã対ç ã¢ãã£ãªã¨ã¤ãåºåãå©ç¨ãã¦ãã¾ãã JavaScript ⺠ç»åï¼IMGè¦ç´ ï¼ã®èªã¿è¾¼ã¿å¾ï¼loadã¤ãã³ãï¼ã®å¦çãåããªã対ç jQueryã使ã£ã¦ãç»åï¼IMGè¦ç´ ï¼ã«ã¤ãã³ããªã¹ãã¼ãè¨ç½®ãããåããªãã£ãã®ã§å¯¾çããã¡ã¢ã§ããä»ã¾ã§æ°ã¥ããªãã£ãã®ãªãã§ããªããã¨ã¡ãã£ã¨ä¸æè°ã§ãããåã«ç©å¿ãã ã¨æãã®ã§åå¿é²ã¨ãã¦æ¸ãã¾ãã ä¸å®ã®ééã§è¤æ°ã®ç»åãã¹ã©ã¤ãããããããªã³ã¼ãããã£ãã£ãã¨æ¸ãã¦ã¿ããã®ã®ãåç»åã大ãããã ã£ãã®ã§ã次ã®ç»åã表示åã«èªã¿è¾¼ã¿éå§ãããããã¨æã£ã¦IMGã¿ã°ã®ãã¼ãã¤ãã³ããåããã¨æã£ãããSafariã§ã¯ãã¾ãåãã¦ããã®ã«ChromeãFirefoxã§ã¯ãã¾ãåãã¾ããã§ããã $('<img
2020å¹´01æ15æ¥ ï¼ 2018å¹´2æ22æ¥ HTML5ããæ°ãã«è¿½å ãããvideoã¿ã°ã使ãäºã§ãHTMLã«åç»ãåãè¾¼ãã®ãã¨ã¦ãç°¡åã«ãªãã¾ãããããã§ä»åã¯videoã¿ã°ã®ä½¿ãæ¹ã¨ãJavaScriptã§ç°¡åã«åç»ãå¶å¾¡ãã¦ããªãªã¸ãã«ã³ã³ããã¼ã©ã¼ãä½ãæ¹æ³ã解説ãããã¨æãã¾ãã ã¾ããvideoã¿ã°ã使ãã«ããã£ã¦ãAndroidã«ãããã®æ³¨æç¹ãè¨è¼ãã¦ãã¾ãï¼ videoã¿ã°ã®HTML5ã¸ã®è¨è¿°ã®ä»æ¹ HTML5ã¸ã®è¨è¿°ã®ä»æ¹ã¯ã¨ã¦ãã·ã³ãã«ã§ããåç»ãæå®ããæ¹æ³ã¨ãã¦å¤§ãã2種é¡ããã¾ããæãã·ã³ãã«ãªè¨è¿°ã¨ãã¦ã¯ã以ä¸ã®ããã«videoã¿ã°ã¨srcã«ããåç»ãæå®ããã ãã§ããï¼â»ãã ããã®ã¾ã¾ã§ã¯åçãã¾ãããï¼ <video src="sample.mp4"></video> ããã²ã¨ã¤ã¯å¹ åºã種é¡ã®ãã©ã¦ã¶ç°å¢ã§åçã§ããããã«ããçºã以ä¸ã®ããã«è¤æ°ã®
JavaScriptã®ãããã°ã¯ãã¦ã§ãéçºã®å¿ é ã¹ãã«ã®ã²ã¨ã¤ã§ããããã°ã©ã ã®å®è¡ããããã°ãããã¨ã§ãç¾å¨ã®å¤æ°ã®å¤ããå¦çãã©ã®ããã«é²ãã§ããã®ãã確èªã§ãã¾ãããããã°ã«ãã£ã¦ããã°ã©ã ãæå³ããåä½ã«ãªã£ã¦ãããã®åæã«å½¹ç«ã¦ããã¾ãã æ¬è¨äºã§ã¯Google Chromeãã©ã¦ã¶ã¼ã®ãChrome Developer Toolsãï¼ä»¥ä¸ããããããã¼ãã¼ã«ãããDevToolsããã»ãã¼ã«ãºãã¨ããç¥ç§°ãããã¾ãï¼ã使ç¨ãã¦JavaScriptããããã°ããéã®åºæ¬çãªä½¿ãæ¹ã解説ãã¾ãããä»ã¾ã§ãããããã¼ãã¼ã«ã使ã£ããã¨ã®ãªããã¨ããæ¹ã§ããã®è¨äºãèªãã°ç解ã§ããããããã¥ã¼ããªã¢ã«å½¢å¼ã«ãªã£ã¦ãã¾ãã20åã»ã©ã§ç解ã§ããããã¾ã¨ãã¦ããã®ã§ãé çªã«è©¦ããªããèªã¿é²ãã¦ãã ããã ãã®è¨äºã§å¦ã¹ãã㨠ãããããã¼ãã¼ã«ã®ä½¿ãæ¹ JavaScriptã®ãã¬ã¼ã¯ãã¤
é åã®ã½ã¼ãã§å°ã£ããã¨ã¯ããã¾ãããï¼å®éãã¾ã«ãã使ããªãã®ã§ãèªåã®åå¿é²ãè¦è¿ãã¦ãã¾ãã ã¨ãããã¨ã§ãå°ã説æãå ãã¦åå¿é²ãã·ã§ã¢ãã¾ãã 説æã¯ãããªããããå¿ è¦ãªãã¨ã ãç¥ãããæ¹ã¯ç®æ¬¡ãããå¸æã®ç®æã«é£ãã§ãã ããã .sort()ã®åºæ¬ã¾ãã.sort()ã®æ§æã¯ä»¥ä¸ã«ãªãã¾ãã arr.sort([compareFunction]) å¼æ°compareFunctionã«ã¯ãã½ã¼ãé ãå®ç¾©ããé¢æ°ãæå®ãã¾ããçç¥ãããå ´åãé åã¯åè¦ç´ ã®æååæ¯è¼ã«åºã¥ãè¾æ¸é ã«ã½ã¼ãããã¾ããArray.prototype.sort() - JavaScript | MDN ããã§è¨ããåè¦ç´ ã®æååæ¯è¼ã«åºã¥ãè¾æ¸é ã«ã½ã¼ããã§ãããæååãUnicodeã¸å¤æããæã®æ°å¤ã§ãã å¼æ°ãæãããªãå ´åã®.sort()ã§ã¯åç´ã«æåãUnicodeã«å¤æããå¤ã§ã½ã¼ããã¦ãã¾ã
æ¥åã¡ã¢ã æè¿ã¯ããªãæ¸ãã¾ããããWebãµã¤ãä½ææãã¾ã«ä½¿ç¨ããããå¾ãªãããã¤ããããã¯ãªãã«ãã«ãããã ç»åã®å¥½ããªå ´æã«ãªã³ã¯ãä»è¾¼ããã®ã¯ä¾¿å©ã§ãããã¬ã¹ãã³ã·ãã®æ¡ä»¶ã§ãã¨ãªã³ã¯ã¨ãªã¢ãæå®ãã座æ¨ããããã¦ãã¾ãããå°ã£ã¡ããã jQuery RWD Image Mapsã¯ãããªæ©ã¿ãä¸çºã§è§£æ±ºãã¦ããã便å©ãªjQueryãã©ã°ã¤ã³ã§ãã 使ãæ¹ ä½¿ãæ¹ã¯é常ã«ç°¡åãã¾ãã¯stowball/jQuery-rwdImageMapsããjsãã¡ã¤ã«ãDLãé©å®ã¢ãããã¼ããã¾ãã HTML [html] <script type="text/javascript" src="jquery-1.11.0.min.js"></script> <script type="text/javascript" src="jquery.rwdImageMaps.js"></script>
ã¹ãã¼ããã©ã³ã®ãã¿ã³ã®ã¿ããUIã¯ã iPhoneã¨Androidã§ã¯ããã©ã«ãã®UIãç°ãªãã¾ãã iPhoneã§ã¯é»ãééããAndroidã§ã¯é»è²ãæ ãã¤ãã¾ãã VIEW DEMO â» ã¹ããã§è¦ã¦ä¸ããã iPhoneã§ã¯ãã¶ã¤ã³ã«ä½ãå½±é¿ãåºãªãã®ã§ããã§ãããAndroidã¯æ¿ãè²ãã¤ãã¦ãã¾ãã®ã§ãé»è²ã使ã£ã¦ããªããµã¤ãã®ãã¶ã¤ã³ã§ããããã©ãè¦ã¦ãä¸èªç¶ã«ç®ç«ã£ã¦ãã¾ãã¾ãã 大åã®ã¹ãã¼ããã©ã³ãµã¤ãã¯ãããã£ãUIã®ã¾ã¾ãªãªã¼ã¹ããã¦ããã®ãç¾ç¶ã§ãã ãããã£ãããã©ã«ãã®ã¿ããUIãæ¶ãã«ã¯ä¸è¨ã®CSSãè¨è¿°ããã°æ¶ãã¾ãã body { -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -moz-tap-highlight-color: rgba(0, 0, 0, 0); tap-highlight-color:
ã¯ããã« JavaScriptã¯ãªãã¸ã§ã¯ãæåè¨èªã§ãããããå©ä¾¿æ§ã®ããã«ãCè¨èªãªã©ã¨åãããã«ã°ãã¼ãã«ãªé¢æ°ãå®ç¾©ããæ§é åçãªææ³ã§ããã°ã©ãã³ã°ãããã¨ãå¯è½ã§ãã ãã®è¨äºã§ã¯ãJavaScriptã«ãããé¢æ°ã®åºæ¬çãªæ§è³ªãè¦ã¦ããã¨å ±ã«ãé¢æ°ã®æ£ä½ãããã³é¢æ°ã®ä½¿ç¨æ¹æ³ã«ã¤ãã¦è§£èª¬ãã¦ããããã¨æãã¾ãã ãªãããã®è¨äºã¯JavaScriptã®è§£èª¬ã§ããããã®å 容ã¯ãæ¨æºä»æ§ã®ECMAScriptã§æ±ãããç¯å²ã«åºã¥ãã¦ãã¾ããå¾ã£ã¦ãåããECMAScriptãå ã«ãã¦ããè¨èªï¼JScriptãActionScriptï¼ã§ãéããå 容ã«ãªã£ã¦ãã¾ãã 対象èªè ããã°ã©ãã³ã°ã®åºæ¬çãªç¥èããªãã³ã«ãªãã¸ã§ã¯ããã¡ã½ããã¨è¨ã£ãåºç¤çãªæ¦å¿µã«ã¤ãã¦ã¯ãããã§ã¯è§£èª¬ãã¾ãããæä½éããªãã¸ã§ã¯ãæåããã°ã©ãã³ã°ã«ã¤ãã¦ç解ããã¦ãã人ã対象ã¨ãã¦ãã¾ãã ãã®è¨äºã¯ã
ãã®ããã°ããªãã¥ã¼ã¢ã«ããã«ããã£ã¦ãã³ã¼ãã£ã³ã°ã楽ã«ããããã«ãã©ã¦ã¶ãã¨ã«CSSã®classãåããPHPé¢æ°ã¨ãMacãå¤å¥ããé¢æ°ãå¿ è¦ã«ãªã£ãã®ã§æ¸ãã¾ããã ãããããã°ãæ´»ç¨ãã ããã ãã©ã¦ã¶ãã¨ã«classãåããPHPé¢æ° çãããç¹å®ã®ãã©ã¦ã¶ã ãå¾®å¦ã«ãºã¬ãçããã¨ãã£ã¦ãã©ããã£ã¦å¯¾å¿ããã¦ã¾ããï¼ ç§ã¯CSSã®ããã¯ã¯ä½¿ããããªãã®ã§ãæ®æ®µã¯IEã®æ¡ä»¶åå²ã³ã¡ã³ãã§å¯¾å¿ãã¦ãã¾ããã å æ¥ããã®ããã°ãHTML5ã§ãªãã¥ã¼ã¢ã«ããã¨ãã« HTML5ãã´ã®ãã¼ã¸ ã®ã½ã¼ã¹ãåèã«ããã®ã§ãããDOCTYPE宣è¨ã®ç´ä¸ã«ãããããµãã«æ¸ããã¦ãã¾ããã HTML ãªãã»ã©ãIE6ã 㨠ie6 㨠ielt8 ããIE7ã 㨠ie7 㨠ielt8 ããIE8ã 㨠ie8 㨠ielt8 ã追å ãããã®ã§ãä¾ãã°IE6ã ãwidthãããããå ´å㯠CSS /*
ãfor+inãã使ãã¨ã§ãã¾ãããªããªã便å©ã var hairetsu = [1,2,3,4,5,6]; for (var i in hairetsu){ alert(i); } ãããªæãã«ãªãã¾ãã prototype.jsã®eaché¢æ°ãªã©ã使ã£ã¦ãåæ§ã®ãã¨ãå®ç¾ã§ããããã§ãã 2 Comments » for inã¯ä½¿ããªãã»ããè¯ãã§ã http://d.hatena.ne.jp/amachang/20070202/1170386546 ã³ã¡ã³ã by mayokara â 2008å¹´1æ3æ¥ @ 02:01 mayokaraããããææãããã¨ããããã¾ããï¼ ã³ã¡ã³ã by kawama.jp â 2008å¹´1æ6æ¥ @ 11:08 RSS feed for comments on this post. TrackBack URL Leave a comment åå
indexOfã«ã¯ãã¾ãç¥ããã¦ãªãè£æçãªä½¿ãæ¹ãããã ããç¥ããã¦ãString.indexOf indexOf æ§æ indexOf(searchValue[, fromIndex]) ãã©ã¡ã¼ã¿ searchValue æ¤ç´¢ããå¤ã表ãæååã fromIndex å¼ã³åºãæååå ã®æ¤ç´¢ãå§ããããã®ä½ç½®ã0 ã¨ãã®æååã®é·ãã®éã«ããæ´æ°ãæå®ã§ãã¾ããããã©ã«ãã®å¤ã¯ 0 ã§ãã æ¦è¦ å¼ã³åºã String ãªãã¸ã§ã¯ã ä¸ã§ãæå®ãããå¤ãæåã«ç¾ããã¤ã³ããã¯ã¹ãè¿ãã¾ããfromIndex ããæ¤ç´¢ãå§ããå¤ãè¦ã¤ããããªãå ´åã-1 ãè¿ãã¾ãã indexOf - MDC Doc Center æ¦è¦ãããããããã«ãæååã®åºç¾ã¤ã³ããã¯ã¹ãåããã®ã ããèå¿ãªã®ã¯è¦ã¤ãããªãå ´å-1ãè¿ããã¨ã ã ãããå©ç¨ãã¦ã¨ããæ¡ä»¶ã®ä¸ã§ä»¥ä¸ã®ä¸ã¤ã®æ£è¦è¡¨ç¾ã©ã¤ã¯ãªãã¨
2007-12-05 ã«ãã´ãª: Client Side ã¿ã°: JavaScript JavaScriptã®ã¤ãã³ãå¦çã¯é¢åãããã ãã©ã¦ã¶ãã¨ã«addEventListenerã¨attachEventã使ãåããããeventãªãã¸ã§ã¯ããå¼æ°ã¨ãã¦åãåããwindow.eventã¨ãã¦åãåãããèããããthisã®æ±ãã«ã¤ãã¦èãããããªãã¦ã¯ãããªãããã ã ã¨ãããã¨ã§ããããè¦ææèãæã£ã¦ããã®ã ããâã®é¢æ°ãæ¸ãã¦ããã ãã§ã»ã¨ãã©ã®ã±ã¼ã¹ã«ã¯å¯¾å¿ã§ããã£ã¦ãã¨ã«æ°ã¥ããã function observe(target, type, listener) { if (target.addEventListener) target.addEventListener(type, listener, false); else target.attachEvent('on'
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}