技術評論社のサイト(gihyo.jp)を見てたらYouTube APIに関する記事があったので読もうとしたんだけど、jQueryも使っててなにしてるかよくわからなかったので、まずjQueryについて本で読んだ。
ボタンクリックでリンクを追加するページ:hello_jQuery.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>title</title>
<script type="text/javascript" src="jquery-1.7.1.js"></script>
</head>
<body>
<button class='foo'>リンク追加</button>
<script>
$('button.foo:first').click(function () {
$('<div><a></a></div>')
.find('a')
.text('JQuery.com')
.attr('href', 'http://jquery.com')
.end()
.appendTo('body');
});
</script>
</body>
</html>
参考サイト
パーフェクトJavaScript (PERFECT SERIES 4)
posted with amazlet at 12.01.31
井上 誠一郎 土江 拓郎 浜辺 将太
技術評論社
売り上げランキング: 4473
技術評論社
売り上げランキング: 4473
関連エントリー
