タグ

関連タグで絞り込む (1)

タグの絞り込みを解除

prototype.jsに関するhrdakinoriのブックマーク (2)

  • Using prototype.js v1.3.1

    What is that? In case you haven't already used it, prototype.js is a JavaScript library initially written by Sam Stephenson. This amazingly well thought and well written piece of standards-compliant code takes a lot of the burden associated with creating rich, highly interactive web pages that characterize the Web 2.0 off your back. When I first started trying to use this library, a few years ago,

  • cyano: prototype.js version 1.4.0系でのEnumerableの使い方

    Ruby on Railsなどのフレームワークに標準付属されていて、オブジェクト指向なJavaScriptを書く人たちの間で注目されているprototype.jsですが、Version 1.3.1時点での機能についての解説書は見つけたものの(prototype.js v1.3.1 の使い方)、1.4系で盛り込まれるであろうEnumerableについては見つけることができませんでした。なので、Version 1.4.0_rc4時点でのEnumerableについて解説してみます。 Enumerableとは、配列やハッシュなどのデータ構造に対して繰り返し処理をさせるための機能を集めたものです。たとえば配列に入っている値それぞれについて処理を行いたかった場合、従来ならば以下のように書いていたでしょう。 var data = [1,2,3,4]; for(var i=0; i<data.length

  • 1