ä»ã®ã©ã¤ãã©ãªããèªåã®ã³ã¼ãã¨å ±åãããã¨ãã¯ããããã®ååã¨è¡çªããªãããã«æ°ãã¤ããå¿ è¦ãããã¾ããåãååã使ã£ã¦ãã¾ãã¨ãã³ã¼ãããã¼ããããé çªã«ãã£ã¦æåãå¤ãããã¨ãããããªãããã«ããåé¡ãçºçãã¦ãã¾ãå ´åãåºã¦ãã¾ãã ãªãã¸ã§ã¯ããã¯ã©ã¹ã®ä½¿ããæ¹ ã©ã¤ãã©ãªå ã§ã¯ãä¸è¨ã®åå空éã¯å¤§ããåãã¦ä»¥ä¸ã®ãããªä½¿ããå½¢ããã¦ãã¾ãã ãã®ä¸ã«å¥ã®ãªãã¸ã§ã¯ããå ¥ããããã®è¦ªåå空éã¨ãã¦ä½¿ã Class.create()ã使ã£ã¦ Prototypeã©ã¤ãã©ãªé¢¨ã®ã¯ã©ã¹ã¨ãã¦å®ç¾©ãã Object.extend()ã使ã£ã¦ä»ã®ã¯ã©ã¹ããªãã¸ã§ã¯ãããç¶æ¿ããããã¨ãåæã¨ããé¢æ°ãéãã ã³ã¼ããç°¡æ½ã«è¨è¿°ããçºã«çãååã®é¢æ°ã¨ãã¦ä½¿ã ç¹ã«ãObject.extend()ã使ã£ã¦ç¶æ¿ãå®ç¾ãã¦ããç®æãå¤ããæçµçã«ã©ã®ãªãã¸ã§ã¯ãã»ã¯ã©ã¹ã«ã©ã®ã¡ã½ãããå®ç¾©ããã¦ã
ã½ã¼ã¹èªã¿ã®æºå æ¬é£è¼ã§ã¯ããã¾ã§ãJavaScriptã®ç¹å¾´çãªè¨æ³ãããã¤ãç´¹ä»ãã¦ãããããããä¸ã«åºã¾ã£ã¦ããJavaScriptã©ã¤ãã©ãªã®ã½ã¼ã¹ã³ã¼ããèªã¿è§£ãã¦ãããã¨ãã§ããã¯ãã ã ä»åããã¯ãå°ã趣åãå¤ãã¦ãJavaScriptã©ã¤ãã©ãªãããã¤ãæããªãããã©ã¤ãã©ãªå©ç¨æ¹æ³ã¨ããã®åä½ã¡ã«ããºã ã«ã¤ãã¦ç´¹ä»ãã¦ãããã ä»åã¯ãprototype.jsã«ãã©ã¼ã«ã¹ãããç¾å¨ã®JavaScript人æ°ã®ç«å½¹è ã¨ãã£ã¦ãéè¨ã§ã¯ãªãprototype.jsã ãããã®ä¸èº«ã¯ã©ããªã£ã¦ããã®ã ããããã½ã¼ã¹ã³ã¼ããèªã¿ãªãããã¡ã«ããºã ã¯ãã¡ãããJavaScriptçãªã³ã¼ãã¹ã¿ã¤ã«ãå¦ãã§ããããã ã¾ãã¯ã½ã¼ã¹ã³ã¼ããèªãããã®ç°å¢ãæ´åããããprototype.jsã¯ãä½è ã§ããSam Stephensonæ°ãæä¾ãããµã¤ãããåå¾ã§ãããç¾å¨ã®å®å®ææ°ãã¼ã¸
Prototype Graphic Framework This open-source framework is developed for my new project NeoMeeting. Prototype.jsãã¼ã¹ã®ã°ã©ãã£ãã¯ã¹æç»ãã¬ã¼ã ã¯ã¼ã¯ã®ç´¹ä»ã åè§å½¢ãåå½¢ãå¤è§å½¢ãªã©ã SVG/VML/Canvas ã®æ¹å¼ã§æç»ãããã¨ãåºæ¥ã¾ãã ã³ã¼ãã¯æ¬¡ã®ããã«ãªãã¸ã§ã¯ãæåã§ã·ã³ãã«ã«è¨è¿°ã§ãã¾ãã(SVGæç»ã®å ´å) // Create an SVG renderer var renderer = new SVGRenderer("whiteboard"); // Create a rectangle with some attributes like color and bounds var rect = new Graphic.Rectangle(rendere
ã¾ãã¯æè¿ç¥ã£ã¦ä¾¿å©ã ã¨æã£ãCSSã®å°æãã²ã¨ã¤ã æç« ã®æå¾ã«ããâ»ï¼ç±³å°ï¼ããªã©ã§æ³¨éãå ¥ãããã¨ãã«ãCSSã®ã¿ã§è¡ã®éå§ä½ç½®ãæããã®ã«ãããã·ã³ãã«ãªããæ¹ãããã .note { padding-left:1em; text-indent:-1em; } <p class=ânoteâ>â»ç±³å°ã使ãå ´åã¯ããã¤ã便å©ã<br /> æ¹è¡ãã¦ããã®éããã¡ããã¨éå§ä½ç½®ãæã£ã¦ãã</p> ãpadding-left : 1em;ãã§ã¾ãï¼æååå³ã«åããã¦ããtext-indent : -1em;ãã§æåã®è¡ã ãï¼æååå·¦ã«åºããã¨ãããã¨ãããã§ããããèãã人ã¯ãããã£ãããã ä»ã«ã¯éå§ä½ç½®ãæãããããããã¶ãä¸ãããCSSã§ããå ´åã<div>ã¿ã°ã®å ¥ãåã使ã£ã¦ããããã<dl><dt><dd>ã®å®ç¾©åãªã¹ãã使ãã®ããããããDefinition Listã®ç¥ã§
prototype.js使ã£ã¦ãã¦ãããããã¨ã®ä¸ã¤ã«bindã使ããã¨ããã®ãããã$()ã¨ãAjaxã®ã¯ãã¹ãã©ã¦ã¶å¯¾çã¨ããããããã©ãthisãbindã§ããã®ã¯å¤§ããªã¡ãªããã ã¨æããbindããªãã¨ã©ãããæã«è¦å´ãããã¨ããã¨ã以ä¸ã®ãããªå ´é¢ã var Foo = function(name) { this.name = name; } Foo.prototype.talk = function(message) { alert(this.name + ": " + message); } function inScope() { var foo = new Foo("foo"); setTimeout('foo.talk("Hello World!")', 0); } inScope(); ããã¯å®è¡ã§ããªãããªããã¨ããã¨setTimeoutã«æ¸¡ãã¦ããfooã¨ããå¤æ°
çè ãPrototype.jsã«åãã¦åºä¼ã£ãã®ã¯ã2005å¹´9æããã ã£ãã¨æãã¾ãããã®é ããªãã¸ã§ã¯ãæåJavaScriptã¯ã¾ã ã¾ã é»ææã§ããªãã¸ã§ã¯ãæåã®æ¸ãæ¹ããã¾ãã¾ãªææµãåå¨ãã¦ãããã¨ãè¦ãã¦ãã¾ãã ãã¡ãããçè ãææµã®ãªãã¸ã§ã¯ãæåã§æ¸ãã¦ãã¾ããããããããã¹ã¦ã®ã¨ã³ã¸ãã¢ãææµã®æ¸ãæ¹ããã¦ãã¦ã¯ãJavaScriptã®ãªãã¸ã§ã¯ãæåã¯æ®åãã¾ããã ãããªæã«ãã¾ãã¾ãªããã°ã§åãä¸ãããå§ããã®ãPrototype.jsã§ãããPrototype.jsã«ã¯ã¯ã©ã¹ãå®ç¾©ããã¨ããæ©è½ãããããã¹ã¦ã®ã¨ã³ã¸ãã¢ãåãæ¹æ³ã§ã¯ã©ã¹ãå®ç¾©ã§ããã®ã§ããããã¯ã大ããªã¤ã³ãã¯ãã§ããããããããã®å½æPrototype.jsã«ã¯ã¾ã¨ã¾ã£ãããã¥ã¡ã³ããç¡ããç®å©ãã®JavaScripterãã¡ã¯ããã£ã¦ã½ã¼ã¹ãèªãã§ãã¾ããã ããã¦ããã®ãã¨ãå³ããã¨ã
2006-11-20T14:20:42+09:00 è¿½è¨ ãä½è ããã«æ»æãåãã¦ããã®ãã¼ã¸ã®å 容ãå·®ãå¤ãã£ã¦ãã¾ãããããã¦ã¦ããã¯ã¢ãããã¡ã¤ã«ãã復æ§ãã¾ããï¼ãä½è ãã = é â¦â¦ï¼ã prototype.jsã10KBã«ããæ¹æ³ã®ç¶ãï¼.htaccessãã¹ãã¼ãã«ä½¿ãï¼ : äºç´°äºãè¾ ã«ç¶ããæ¸ãã¾ãããåããã¦ã©ããã JavaScript ãã¡ã¤ã«ãå§ç¸®ãã æ£çæ£éãPrototypeï¼âprototype-1.4.0.jsâï¼ã10ãããã¤ãï¼10,453 bytesï¼ã«å§ç¸®ãã¦ããããï¼å½ããåãªããï¼åä½ããããã«ããæ¹æ³ã§ãã ââã¨èãã¦çã£å ã«æãæµ®ãã¶ã®ããå種JavaScriptãã¡ã¤ã«å§ç¸®ãµã¼ãã¹ããã¨ãã人ãå¤ãã§ãããã ããããèªåã試ãã¦ã¿ãã¨ãããä¾ãã°/packer/ã§å§ç¸®ããJavaScriptãã¡ã¤ã«ã¯ä¸æãåä½ãã¾ããã§ããï¼ä»ã¯
JavaScript ã§ã®å¤æ°ã使ã£ãæååã®ä½æã¯ä½ãã¨ããã©ãããã§ãããprototype.js ã§ã¯ 1.5_pre0 ãã Template ã¨ããç°¡æãã³ãã¬ã¼ãã¨ãã¦ä½¿ããã¯ã©ã¹ãå ããã¾ãããç¸å¤ãããããã¥ã¡ã³ãã¯ã½ã¼ã¹ã¨ test å«ãªã®ã§ç°¡åãªä½¿ãæ¹ãç´¹ä»ãã¾ãã ã¾ã㯠Template ã¨ãªãæååã new Template ã§ä½ãã¾ããTemplate ã®ãªãã©ã«ã¯ #{}ã§ã*1 ã var t = new Template('#{foo}, #{bar}!');次ã«ä½æãã Template ã¤ã³ã¹ã¿ã³ã¹ã® evaluate é¢æ°ãå¼ã³åºããå¼æ°ã¨ã㦠Hash(Object) ã渡ãã¾ãã t.evaluate({ foo: 'hello', bar: 'world' }); // hello, world!ãããã³ãã¬ã¼ãã使ãåãããä¸åº¦éãã®æåå
prototype.js(確èªããversionã¯1.4.0)ã¯IE6.0以ä¸ãã¿ã¼ã²ããã¨ãã¦ããã確ãã«IE5.5ã§ã¯Ajaxãåããªãå ´åãããã¾ãããã ããã¯ãprototype.jsãã¡ãã¡ããã¨ä¿®æ£ããã ãã§åä½ããããã«ãªãã¾ãã 640è¡ç®ã§ this.transport.open(this.options.method, this.url, this.options.asynchronous);ã¨XMLHttpRequestããªã¼ãã³ãã¦ããã¨ãããããã¾ãããprototype.jsã§ã¯ä½æ ãmethodã®æå®ãå°æåã§ãgetããpostãã¨æ¸¡ããªãã¦ã¯ããã¾ããã ã©ããIE6.0ãFirefoxã¯this.transport.openã®ä¸ã§å¤§æåå¤æãããã£ã¦ãããããªã®ã§ãããIE5.5ã¯ããããããå°æåã®ã¾ã¾HTTPãªã¯ã¨ã¹ããéããã¦ããããã§ãã ãµã¼ã
社å ã®ç²¾éã¨ã³ã¸ãã¢ãä¸å¿ã«å®æçã«åå¼·ä¼ããããã¨ã«ãªã£ãããã§ã JavaScript ã®è¬ç¾©ã¯åããããã¨ã«ãªã£ãã è³æã社å ã ãã§ã¨ã©ãã¦ããã®ã¯ãã£ãããªãã®ã§ãããã«å ¬éãã¦ããã¾ãã社å ã®äººã社å¤ã®äººãèªãã§ãã ããã è¬ç¾©ã®å 容ã¯åºæ¬çã«ã½ã¼ã¹å«ãã½ã¼ã¹ã¬ãã¥ã¼å½¢å¼ã â»ã¿ã¼ã²ãã㯠JavaScript ã¯æ¸ãããã¨ãªãããªãã¸ã§ã¯ãæåè¨èªããã°ã©ãã Section 00 Prototype.js ã®åã« JavaScript ã®ãªãã¸ã§ã¯ãã®æ¦è¦ã»ã»ã» ãªãã¸ã§ã¯ããä½ã£ã¦ã¿ãã var object = {};ãªãã¸ã§ã¯ãã«ã¡ã½ããã¨ãããããã£ã追å ãã¦ã¿ãã var object = { field: 'ITæ¦å£«', method: function() { alert('hello ' + this.field); } }; object.method()
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}