prototype
How well do you know prototype (part II)
1) Detecting key events easily How do we detect which key was pressed? Prototype provides set of key event aliases so that we don’t have to remember that return is “13″ and escape is “27″. Almost all major keys are aliased: KEY_RETURN, KEY_ESC, KEY_TAB, KEY_LEFT, KEY_UP, KEY_RIGHT, KEY_DOWN. See full list in API docs $(‘myInput’).observe(‘keyup’, [...]
How well do you know prototype?
How well do you know prototypeor taking advantage of those extra 100 KB in your pageLet’s be honest – I’m tired of answering same questions over and over again. Prototype.js is a widely used javascript library with somewhat confusing online documentation. I personally find API reference to be a great resourse overall (with few glithes [...]
prototype.js utility functions
$() 함수 사용하기 $()함수는 가장 많이 사용되는 DOM의 document.getElementById()함수에 대한 편리한 단축키이다. DOM함수처럼, 이것은 인자로 던져진 id를 가진 요소를 하나 반환한다. 하지만 DOM함수와는 달리, 이것은 여러개의 id를 사용할수 있고 $()는 요청된 요소를 가진 Array객체를 반환할것이다. 예제는 아래와 같다. <HTML> <HEAD> <TITLE> Test Page </TITLE> <script src=”prototype-1.4.0.js”></script> <script> function test1() { var d = $(‘myDiv’); alert(d.innerHTML); [...]