![WEB制作者が一度は触ってみておくべきオープンソース『Ext』*ホームページを作る人のネタ帳](https://cdn-ak-scissors.b.st-hatena.com/image/square/2917af5e69ff9ca5cf4425102260bc487a0f3ca4/height=288;version=1;width=512/https%3A%2F%2Fblog-imgs-13.fc2.com%2Fe%2F0%2F1%2Fe0166%2F200707162114.gif)
Creating web sites for the Wii Opera browser Though it may be old news that Wiimote keycodes can be detected by JavaScript in the Wii Opera browser, I could not find a JavaScript library that facilitates handling these input events, so I created my own. Wii用のサイトを作る際に超便利なJavaScriptライブラリ「wii.js」 wii.jsをインクルードすると次のようなAPIを使うことが出来ます。 wii.isWiiOperaBrowser() - WIIで見ているかどうかを true/ false で返す wii.setupHand
JavaScript, jshjsh ブックマークレット版は以下。 javascript:(function(){var BASE='http://www.asahi-net.or.jp/~xe4r-kmt/jsh/';with(window.open('','_blank','width='+screen.width*.6+',left='+screen.width*.35+',height='+screen.height*.9+',resizable,scrollbars=yes')){document.write('jsh');document.close();}})() 名前、いろいろ考えたけど、jshになりました。 画面はLDRで購読リストを調査しているもの。各機能については、これから少しずつポストします。 補完候補のタイプ表示も追加して、非列挙プロパティの補完も対応し、一段落。
■ フォームの入力エラーを吹き出しで教えてくれる JavaScript フォームの validation 関連のライブラリはいくつかありますが、私は以下に紹介するやつをずっと使ってまして、これがかなり気に入ってます。ただ、オレナイズされたコードが随所に含まれていたから紹介する事が出来ないでいたのですが、今回やっと書き直したのでお目見えです。 AJAX を使ってサーバサイドと連携、とかそういう事も全くやってなくて、普通に JavaScript のみで入力のチェックをしてるだけなんで、真新しい事はないんですが。 実際の動作サンプル とりあえず submit ボタンを押せば、全て理解出来るかと思います。 今回は CSS のファイルと画像のファイルといっぱい出来てきてしまっていて、いつもの「読み込ませるだけ」とはちょっと毛色も違い、使うのには事前の準備が必要で面倒です。 いつもの JavaScri
MD5 is a secure hash algorithm. It takes a string as input, and produces a 128-bit number, the hash. The same string always produces the same hash, but given a hash, it is not generally possible to determine the original string. Secure hash algorithms are useful for protecting passwords and ensuring data integrity. This site has a JavaScript implementation of MD5, and some other secure hash algori
BlueShoes: JavaScript Collection Get all the above components in one package. There is an example that uses most of the components.忘れてはいけない超絶JavaScriptライブラリ「BlueShoes:JavaScript Collection」。 既に紹介したと思っていたJavaScriptライブラリであるBlueShoesの紹介。 ご存知の方も多いと思いますが、知らない人も多いようですね。 ライブラリ、というより、リッチなコンポーネント集といったイメージで、次のような様々なコントロールが使えます。 WYSIWYGエディタ Excel風スプレッドシート ツリービュー スライダーコントロール 他にも下記の様々なリッチコンポーネントが使えます。 入力系コンポーネ
Adobe stopped supporting Flash Player beginning December 31, 2020 (“EOL Date”), as previously announced in July 2017. Open standards such as HTML5, WebGL, and WebAssembly have continually matured over the years and serve as viable alternatives for Flash content. Also, major browser vendors are integrating these open standards into their browsers and deprecating most other plug-ins (like Flash Play
Object 汚染とは 簡単に言うと Object.prototype を拡張したときに、すべての for in に影響を与えてしまって、いろんなことが困る。という問題である。 DontEnum という内部属性をスクリプトから与える手段がないために発生する。 Object.prototype.hoge = 'ほげ'; for (var p in {}) alert(p); // hoge と表示される ActionScript では setPropertyIsEnumerable という関数が Object.prototype に宣言されている。 これを使うことによって、安全にすべてのオブジェクトにメソッドやプロバティを追加することができる。 例えば 以下のソースをコンパイルすると package { import flash.display.Sprite; import flash.te
komagataです。 最近、色々なソースを読んでJavascriptの勉強をしているんですが、その中で比較的ソースが短く、シンプルなものが多いのでJSANのライブラリを参考にさせてもらっています。出来てから1年以上経ってるのにイマイチ使われていないような気がしますが、勉強ついでに以前作ったpprompt.jsというライブラリをJSAN用に変更してアップしてみました。 jsan logo posted from フォト蔵 そもそもJSANとはJavaScript Archive Networkの略で、要はTeXのCTAN、PerlのCPAN、PHPのPEARみたいなライブラリをアップしたりできるところだそうです。(アップに際して厳密な投票プロセスなどは無いのでPEARとは少し違うかもしれません) JSANライブラリの使い方は長くなるので下記等を参照していただいて、早速アップするモジュール作
とてもシンプルに自分自身が属する script 要素を取得 http://d.hatena.ne.jp/amachang/20061201/1164986067 document.writeをDOM仕様にする http://nyarla.net/blog/javascript-tips1 あたりに着想を受けて、作ってみました。 http://la.ma.la/misc/js/lazy_writer/ 特定のscript src内のdocument.writeをピンポイントに置き換えることができます。 制限事項としては、document.writeを使ってscriptタグを生成するようなコードの場合、IEではinnerHTMLにscriptを書いても実行されないという仕様があるので実行されません。その点を除けば、IFRAMEをdocument.writeで挿入するような、良くある広告系のdo
グローバル領域に以下の一行を書く <script> var currentScript = (function (e) { if(e.nodeName.toLowerCase() == 'script') return e; return arguments.callee(e.lastChild) })(document); alert(currentScript); </script>こうすることで、currentScript はこの script 要素を指す。 いちおう説明 DOM は構築されるときに、上から順番に構築される。そして、script タグがあると、 script 要素を構築したあとに、スクリプトを実行する。 つまり、スクリプトが実行されたとき script 要素は今まさに作られたばかりであり、それよりも後ろの要素が存在しない。さらにこの script 要素を含むすべての要
特定のscript中に含まれるdocument.writeを上書きして、遅延描画にすることができます。 document.writeを使う広告配信スクリプトや、ブログパーツなどの挙動を置き換えることが出来ます。 外部サーバーから読み込むスクリプトをページ最後部に記述することでページレンダリングを妨げなくなります。 このページはこんな感じになってます。 var adsense_url = 'http://pagead2.googlesyndication.com/pagead/show_ads.js'; document.lazy_writer(adsense_url, function(str){ var id = "adsense_" + this.script_count; document.getElementById(id).innerHTML = str; }, {delay :
ここ最近、prototype.js や scriptaculous.js に話題が偏りがちでしたが、MochiKit という JavaScript ライブラリも注目されています。(別に無視していたわけではなく、単に追っかけきれていないだけです。そもそも公開されているライブラリやフレームワークの数が尋常じゃないので..。cf. Round-up of 50 AJAX Toolkits and Frameworks)prototype.js や scriptaculous.js が Ruby on Rails のフロントエンドをサポートしているなら、MochiKit は TurboGears という、Python ベースの Web アプリケーション開発フレームワークのフロントエンドを支えています。 ブックマークレットを利用したデバッガや、データを昇順・降順に並べ替えられるソータブルテーブル、キ
ECMAScript® 2023 language specification 14th edition, June 2023 This Standard defines the ECMAScript 2023 general-purpose programming language. Kindly note that the normative copy is the HTML version; the PDF version has been produced to generate a printable document. This 14th edition has been prepared under the Ecma RF patent policy. Please note that for ECMAScript Edition 4 the Ecma standard nu
In getting to know Prototype a little better, I decided to go through the latest version of the Prototype library (1.5.0_pre0) and detail every method and property that was available. In doing so, I got a much better understanding of how the code works. Here are the files in a 1280x960 and a widescreen 1440x900 version. 1280x960 1440x900 1280x960 on White 1440x900 on White And with WHITE backgroun
JavaScript Tutorials Complete beginners JavaScript basics JavaScript first steps JavaScript building blocks Introducing JavaScript objects JavaScript Guide Introduction Grammar and types Control flow and error handling Loops and iteration Functions Expressions and operators Numbers and dates Text formatting Regular expressions Indexed collections Keyed collections Working with objects Using classe
JavaScript チュートリアル 初級編 JavaScript の基礎 JavaScript の第一歩 JavaScript の構成要素 JavaScript オブジェクト入門 JavaScript ガイド 入門編 文法とデータ型 制御フローとエラー処理 ループとイテレーター 関数 式と演算子 数と日付 テキスト処理 正規表現 インデックス付きコレクション キー付きコレクション オブジェクトを利用する Using classes プロミスの使用 JavaScript 型付き配列 イテレーターとジェネレーター メタプログラミング JavaScript モジュール 中級編 クライアントサイド JavaScript フレームワーク クライアントサイド Web API Language overview JavaScript のデータ構造 等値比較と同一性 プロパティの列挙可能性と所有権 クロ
やっていることは「高度な JavaScript 技集」の「UTF-8 <-> UTF16 変換」と同じ。 function toUTF8Octets(string) { return unescape(encodeURIComponent(string)); } function fromUTF8Octets(octets) { return decodeURIComponent(escape(octets)); } encodeURIComponent は encodeURI でもいい (むしろそのほうが処理する文字種が減って速くなりそう) が、decodeURIComponent は decodeURI にすると一部の文字 ("?"、"#" など) がデコードされなくなる。 使いどころ Base64 エンコードする関数 (「高度な JavaScript 技集」の base64encod
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く