開発環境
- OS X Mavericks - Apple(OS)
- Emacs (CUI)、BBEdit - Bare Bones Software, Inc. (GUI) (Text Editor)
- Safari、Firefox + Firebug (Webプラウザ、プラグイン)
- JavaScript (プログラミング言語)
- jQuery (JavaScript Library)
Head First JavaScript ―頭とからだで覚えるJavaScriptの基本( Michael Morrison (著), 豊福 剛 (翻訳)、オライリージャパン)の12章(ダイナミックなデータ)、自分で考えてみよう(p.593)を解いてみる。
その他参考書籍
自分で考えてみよう(p.593)
コード(BBEdit)
ajax.js
var entry_date = document.getElementById('entry_date'),
entry_body = document.getElementById('entry_body'),
initForm = function () {
entry_date.value = (new Date()).shortFormat();
entry_body.focus();
};
Date.prototype.shortFormat = function () {
return (this.getMonth() + 1) + '/' + this.getDate() + '/' +
this.getFullYear();
};
initForm();
0 コメント:
コメントを投稿