kudox.jp 2024 著作権. 不許複製 プライバシーポリシー
続編も書きました : 結局jQuery.Deferredの何が嬉しいのか分からない、という人向けの小話 jQuery version1.5で導入されたjQuery.Deferredは、無くてもコードを書けるけど、使えば少しコードが綺麗かつ見通しが良くなる、という機能。 無くても書けるという機能がなかなか使われないというのは世の常なので、jQueryクックブック(O'REILLY)の中でも言及されていない、なんとも寂しい状況だ。 ちょっとここらで一肌脱いでやるか、という趣旨で書き始めたら無駄に長くなった。 とりあえず使ってみたい、という人は下の方の「jQuery.Deferred自体の使い方」までジャンプするとよい。 jQuery.Deferredとはどういう場面で使うものなのか コールバックを渡して非同期処理完了時にそれを呼び出してもらうような場面。 具体的には $.get('hoge',
今日の概要 実は使われてるJavaScript AST JavaScript AST(Abstract Syntax Tree)とは? JavaScript ASTを使ったツール紹介 使うだけじゃなくて書いてみよう browserify Node.jsで書かれたものをブラウザ向けに変換するツール Node環境で開発 -> browserifyでビルド -> ブラウザで動く JavaScriptのコードを 変換 する ≒ JavaScript ASTを見て変換 する 本体の色々な部分、transform pluginなどでASTを使ってる
RegExr is an online tool to learn, build, & test Regular Expressions (RegEx / RegExp). Supports JavaScript & PHP/PCRE RegEx. Results update in real-time as you type. Roll over a match or expression for details. Validate patterns with suites of Tests. Save & share expressions with others. Use Tools to explore your results. Full RegEx Reference with help & examples. Undo & Redo with {{getCtrlKey()}}
前回はJavaScriptのプロトタイプチェーンについて、図解を用いることでなんとか理解できました。今回はスコープチェーンに挑戦してみます。前回と同じく「1. 図解を用いる」「2. 用語を明確に定義する」「3. Standard ECMA-262 3rd editionを情報ソースとする」というアプローチで紐解いて行きます。 用語の定義 ・本エントリの文章における表記は、以下の表の「ECMA-262 3rd」に統一する ・本エントリの図における表記は、以下の表の「本エントリの略称」に統一する ・本エントリ内におけるES3とは、Standard ECMA-262 3rd editionを指す ECMA-262 3rd 本エントリの略称 JavaScript(サイ本)第5版(日本語) Execution Contexts EC 実行コンテキスト Variable Object VO 変数定義の
JavaScriptのプロトタイプチェーンについて理解しようとしたのだけど、prototypeとか__proto__とかごちゃごちゃになって、色んなブログを読んでもなかなか理解しきれなくて悶々としていたのだが、図を書いたらパッと理解できた!以下、情報ソースはなるべくECMAScript仕様書(3rd)を元にするようにして書きました なぜ分かりづらいのか? そもそも、なぜJavaScriptのプロトタイプチェーンは自分にとってこうも分かりづらかったのだろうか?自分なりに分析してみると、まず、「似ているが違う用語が沢山ある」という点がある。ざっとあげただけでも、「prototypeと__proto__」「__proto__と[[Prototype]]」「FunctionとFunctionオブジェクト」などがある。そして次に、「入り組んだ構造が動的に変化する」という点がある。上記のように似たよう
10 Small Things You May Not Know About Javascript18th of Feb 2010 - Samuli Hakoniemi It doesn’t matter how many years I’ve been dealing with Javascript – it contains many little things that surprises me almost every week. For me, Javascript means a constant learning process. In this article, I’ll provide ten small Javascript tips, mainly aimed for beginner and intermediate Javascript developers. H
ヤフー株式会社は、2023年10月1日にLINEヤフー株式会社になりました。LINEヤフー株式会社の新しいブログはこちらです。LINEヤフー Tech Blog Yahoo!デベロッパーネットワークの中野(@Hiraku)です。これまで、JavaScriptで非同期処理を書く上での問題として、コールバック地獄やエラー処理に例外が使えないことなどを解説してきました。 これらの問題に対処するライブラリの1つであるjQuery.Deferredに関して、もう少し丁寧に解説いたします。なお、jQueryのバージョンは記事執筆時点の最新である、1.9.1を想定しています。 jQuery.Deferredとは jQuery.DeferredとはjQueryのバージョン1.5から導入された、非同期処理をうまく扱うための標準モジュールです。使いこなすことで、以下のような効果が見込めます。 非同期処理を連結
* version 0.3.0を使用 * 何ができるか PreloadJSを使うと"ファイルの読み込みが終わってから何かする"という方法に一貫性を持たせることができるようになります。 利用シーンとしてはアニメーションの開始前に必要なファイルを確実に読み込ませたいとか色々考えられそうです。 使い方 画像の読み込みが完了してから処理を行う loadFile()の記述方法いろいろ loadManifestで複数ファイルを一括で登録する completeイベント itemのもつプロパティ ファイルの種類を判定して処理を行う 登録したアイテムをqueueから削除する 使い方 PreloadJSのサイトからダウンロードします。*執筆時点の最新は0.3.0* http://www.createjs.com/#!/PreloadJS APIドキュメント http://www.createjs.com/Do
JavaScript で作って意味があるのかどうか分かりませんが、作ってみました。 応用編 入力したテキストをページ上に書き出し、個々の文字をドラッグ&ドロップ で動かせるようにする ソースを読んでも中身が分からない HTML を作成する パスワードチェックの部屋 (パスワードは「開けごま」ですが、HTML のソースや JavaScript を解析しても、絶対にパスワードが分からない仕組みになっています。) バー ライブラリ編 こんなの JavaScript で作るかよってな代物です。 できてしまったものはしょうがないでしょう。 utf.js (UTF-8 <-> UTF16 変換) base64.js (Base64 encode/decode) md5.js (MD5) des.js (DES 暗号化/復号化) zlib.js (JavaScript による zlib 実装、zlib
これ読んでたらr7kamura君にJSのMVCどうするの的な話きかれてたのを思い出したので、自分がBackboneを使う時のパターンをr7kamura君の記事をベースに書きなおしてみた。 > サバクラ両方で動く JavaScript の大規模開発を行うために ― Gist https://gist.github.com/1362110 > client-side javascript - ✘╹◡╹✘ http://r7kamura.hatenablog.com/entry/2012/10/18/023629 以下の様なコードを書いた。かなり冗長だが、複雑なアプリだとこれぐらいの冗長性は必要になる。 (なお概念を伝えるための解説用コードなのでそのままじゃ動かない) Backbone.Model # 名前空間の初期化 App = {} App.View = {} App.Model = {}
java-ja.js #2 : ATND 自己紹介 文殊堂といいます。 BePROUDという会社のリーダーです ↑はロケタッチの話です(ロケタッチ知らない人は4SQでMayorになったみたいな話だと思っといてください)。 弊社では今(2010年12月現在)人材募集中らしいですよ。 今の仕事はUIがリッチな業務システムを作るとかそんな感じで、 そこでRequireJSを使っています。 RequireJSって何? 公式サイト RequireJS スライド jQueryRequireJS.pdf 日本語記事だとこの辺? http://zudolab.net/blog/?p=451 要はJavaScriptの依存性解決をしてくれるライブラリです。 以前RequireJS moduleについてって記事書きました。 あらためてRequireJS moduleについて まず最初に、一般的な言語と同じよう
REQUIRE JS JSの非同期ローディングとモジュール化を行うライブラリ 公式サイト 詳しくは、RequireJS実践編を参照 下記順番で読み込み(config-require.jsは自作。名前はなんでも良い) <script src="config-require.js"> <script data-main="main" src="require.js"> 非同期ローディングについて 下記を参考にconfig-require.jsを作成 設定値の詳細はこちらを参照 var require = { deps: ["some/module1", "my/module2", "a.js", "b.js"], callback: function(module1, module2) { //This function will be called when all the dependen
Not your computer? Use a private browsing window to sign in. Learn more about using Guest mode
PHPによるデザインパターン入門 秀和システムから発売となった「PHPによるデザインパターン入門」(ISBN4-7980-1516-4・ 2006/11/23発売)を執筆しました(共著です)。 「PHPを使ってGoFパターンを見ていこう」的な書籍になっています。GoFパターンについては、それぞれパターンの説明とサンプルコードという構成です。サンプルコードは、CentOS4.4/Windows XP(SP2)+PHP5.1.x/5.2.0で動作確認しています。 目次は以下の通りです。 1章 デザインパターンの世界へようこそ デザインパターンって何? デザインパターンとは? オブジェクト指向 GoFパターン デザインパターンのメリット・デメリット デザインパターンを使うメリット デザインパターンを使うデメリット PHPとオブジェクト指向 PHPとは? PHP5でのオブジェクト指向開発 2章
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く