Ajaxで今よみがえる(^^;;-->[クロスブラウザ技術 ]DHTMLサンプル集
-- リスト --
【カテゴリー】 ActionScript ( 6 ) AIR ( 4 ) AjaSQL ( 10 ) Ajax ( 675 ) Arax ( 1 ) canvas ( 15 ) CSS ( 24 ) ( 9 ) DLNA ( 1 ) Dojo ( 25 ) DOM ( 51 ) ES4 ( 4 ) Ext JS ( 5 ) 反重力物質 ( 1 ) ffAdd-on ( 1 ) Flash ( 48 ) Flash Remoting ( 11 ) FTP ( 2 ) GAF ( 9 ) Google Maps ( 124 ) Google ガジェット ( 1 ) GPS ( 44 ) HTML ( 11 ) HTTPヘッダサンプル ( 10 ) IME ( 2 ) Internet ( 2 ) iPhone ( 49 ) IPv6 ( 1 ) 漫画 ( 4 ) Java ( 49 ) JavaScript ( 344 ) jKamo ( 8 ) jQchart ( 4 ) jQuery ( 207 ) jquery-ref ( 1 ) jsGadget ( 19 ) jslb_ ( 3 ) jslb_ajax ( 9 ) JSON ( 49 ) JSR223 ( 7 ) kjscmd ( 1 ) KNOPPIX ( 1 ) Linux ( 18 ) Mac ( 9 ) Memo ( 3 ) Microformats ( 2 ) Mini AJAX ( 2 ) MochiKit ( 2 ) mootools ( 10 ) Movable Type ( 58 ) MySQL ( 10 ) NewGameWeb ( 2 ) Nucleus ( 8 ) OpenAJAX ( 3 ) OpenDocument ( 1 ) OS ( 10 ) P2P ( 2 ) Perl ( 8 ) PHP ( 38 ) PostGIS ( 1 ) PostgreSQL ( 4 ) prototype.js ( 28 ) ROBOT ( 1 ) RSSリーダー ( 15 ) Ruby on Rails ( 7 ) SPDY ( 1 ) Spry ( 6 ) SQLite ( 17 ) SQLiteWorker ( 2 ) ssh ( 1 ) SSI ( 2 ) SVG ( 23 ) TRON ( 1 ) Ubiquity ( 7 ) Video ( 1 ) VML ( 1 ) Web Slice ( 1 ) Web Sockets ( 24 ) Webサービス ( 107 ) widget ( 6 ) Wii ( 1 ) Wiki ( 1 ) Win ( 6 ) WSH ( 1 ) X01HT ( 30 ) XML ( 32 ) XOOPS ( 1 ) XQuery ( 2 ) XUL ( 4 ) Yahoo! UI ( 74 ) 日付入力用カレンダー ( 1 ) 『Ajax実践テクニック』 ( 1 ) 『入門 Ajax』 ( 42 ) WinTips ( 2 ) こりゃすごい ( 7 ) チューニング ( 30 ) ダイナミックロード関数 ( 7 ) リファレンス ( 20 ) ライブラリ ( 210 ) レーダー雨量表示 ( 1 ) ハード ( 35 ) ペンギン ( 2 ) ブラウザ ( 108 ) ブログでBBS ( 1 ) アクセスグラフ ( 3 ) イベント ( 2 ) カレンダーによる日付入力スクリプト ( 4 ) クロスブラウザ ( 14 ) クロスブラウザ関数 ( 8 ) スポーツ ( 1 ) スマートフォン ( 8 ) セキュリティ ( 155 ) ソフトイーサ ( 1 ) マッシュアップ ( 23 ) 暗号 ( 4 ) 映画 ( 57 ) 河川の水位グラフ ( 3 ) 回線 ( 2 ) 開発ツール ( 38 ) 牛久大仏 ( 19 ) 携帯 ( 150 ) 言語 ( 19 ) 故障 ( 9 ) 高橋家の謎 ( 3 ) 広告とか ( 1 ) 洪水警報システム ( 2 ) 今日のひと言 ( 10 ) 仕様 ( 113 ) 雑談 ( 356 ) 実装 ( 2 ) 書籍 ( 20 ) 親子ウインドウ有無の確認関数 ( 3 ) 新海誠 ( 3 )
Web Sockets Domo

* サーバー側は、小松氏のこれをbloga.jp:80へ置いてあります。
* クライアント側はWS処理をjQueryプラグイン化してみました。これです。
* ちなみに、このDemoサンプルは、下記5行でローカルでも別ドメインでもどこにでも設置出来ます。
<script src="http://bloga.jp/ws/jq/js/jquery-1.3.2.min.js" type="text/javascript"></script> <script src="http://bloga.jp/ws/jq/js/jquery.ws-0.3-noenc-pre.js" type="text/javascript" charset="utf-8"></script> <script src="http://bloga.jp/ws/jq/conn/wschatdemo0.3.js" type="text/javascript"></script> <script>/*サポートしてない時のalertメッセージを抑止*/$.ws.wsSetup({nonosupportmsg:true});</script> <div id="wsdemos"></div>

【info】いつもいろいろなテストなどをページ内のあちこちでやっているので、重かったり、壊れていたりするf^^;ことも多いです。実験用ですので、カオス(混沌)をあえて意図したりもしますので、標準やValidとは無縁だったりしますが、何卒、ご了承ください ( _ _ b

【info】 最近はTwitterでぶつぶつ言ってることが多いです。
>http://twitter.com/toshirot

【info】 Chrome Extension [WebSocket Chat] もちろんChrome専用です
https://chrome.google.com/extensions/detail/fnoegeafibddabfhmpmhniphlcojkjli

2006年08月03日

【Yahoo! UI】YUIのyahoo.jsのYAHOO.extend

JavaScript , Yahoo! UI , prototype.js ブックマークに追加する ブックマーク-- Hatena  / Livedoor track feed


YUIのv0.11.2を眺めていたら、yahoo.jsにYAHOO.extendが追加されていました。要するに継承の実装なわけですが、prototype.jsのextend のようなシンプルなコピーではなくて、コンストラクタとメソッドをチェーンでつなぐと。うーん、今、試す時間がない、けど、メモ。
/** * Utility to set up the prototype, constructor and superclass properties to * support an inheritance strategy that can chain constructors and methods. * * @param {Function} subclass the object to modify * @param {Function} superclass the object to inherit */ YAHOO.extend = function(subclass, superclass) { var f = function() {}; f.prototype = superclass.prototype; subclass.prototype = new f(); subclass.prototype.constructor = subclass; subclass.superclass = superclass.prototype; if (superclass.prototype.constructor == Object.prototype.constructor) { superclass.prototype.constructor = superclass; } };
と思ったら、READMEにちゃんと書いてありました。
0.11.0 * Added YAHOO.extend, which provides an easy way to assign the prototype, constructor, and superclass properties inheritance properties. It also prevents the constructor of the superclass from being exectuted twice.
ざっくり訳::0.11.0 * YAHOO.extendを加えました。(YAHOO.extendはプロパティの継承をプロトタイプ、コンストラクタ、およびスーパークラスに割り当てる簡単な方法を提供します)。 それによって、二度スーパークラスのコンストラクタがexectutedされることはありません。
別物ですが、一応、ちなみに、prototype.jsのObject.extend
Object.extend = function(destination, source) { for (var property in source) { destination[property] = source[property]; } return destination; }
ついでに、私が愛用しているコピー関数copyOj。prototype.jsのObject.extendと等価ですがObject汚染しないただの関数です。
function copyOj(oj,aoj) { for(var i in aoj){ oj[i]=aoj[i] };return oj; } //applyを使わないのはfor MacIE


ちなみに、JavaScriptでの継承つながりで、こういうのを作っている方もいます。 クラスパッケージ化ツール CPT

  

All About/JavaScript

All About のJavaScript関連記事を書いています。参考にしていただければ幸いです。