2015年1月22日木曜日

開発環境

  • OS X Yosemite - Apple (OS)
  • Safari, Firefox, Google Chrome(Webプラウザ)
  • Emacs (CUI)、BBEdit - Bare Bones Software, Inc. (GUI) (Text Editor)
  • HTML5 (マークアップ言語)
  • JavaScript (プログラミング言語)

Head First HTML5 Programming: Building Web Apps with Javascript(Eric Freeman (著)、Elisabeth Robson (著)、O'Reilly Media)のChapter 3(Events, Handlers and All that Jazz: A Little Interaction)、SHARPEN YOUR PENCIL(No. 1944)を解いてみる。

その他参考書籍

SHARPEN YOUR PENCIL(No. 1944)

JavaScript (BBEdit, Emacs)

var init = function(){
    var button = document.getElementById('addButton'),
        handleButtonClick = function() {
            var textinput = document.getElementById('songTextInput'),
                songName = textinput.value;

            if (songName === '' || songName === null) {
                alert("Enter a song name!");
            } else {
                alert('Adding ' + songName);
            }
        };
    
    button.onclick = handleButtonClick;
};

window.onload = init;

sample1637.html

0 コメント:

コメントを投稿