※ このエントリーはニコニコ動画のサムネイルページをうまく表示できるかを確認するためのテスト投稿記事です。この記事の詳細ページに表示されているサムネイルはJavaScriptにより呼び出されています。
<div onclick="EchoNicoNico(this);" class="EntryObject_NicoNico">
<dl>
<dt>ドナルドデイズ</dt>
<dd>sm1462122</dd>
</dl>
</div>
(ここをクリックするとソースをわかりやすく整形したサブウインドウがポップアップします)
function EchoNicoNico(NicoData){
NicoTitle = NicoID = "";
if(!(EchoSpace = NicoData.getElementsByTagName('dl')[0])){
return;
}
if(!(NicoTitle = EchoSpace.getElementsByTagName('dt')[0].innerText)){
NicoTitle = EchoSpace.getElementsByTagName('dt')[0].textContent;
}
if(!(NicoID = EchoSpace.getElementsByTagName('dd')[0].innerText)){
NicoID = EchoSpace.getElementsByTagName('dd')[0].textContent;
}
Is_ModernBlowser = CheckModernBlowser();
// CheckModernBlowser()ではIE7をのぞくモダンブラウザは2、IE7は1、それ以外のレガシーブラウザは0を返す自作関数
if(Is_ModernBlowser >= 2){
// ForIE => <object classid="clsid:25336920-03F9-11CF-8FD0-00AA00686F13" codetype="text/html" data="http://www.nicovideo.jp/thumb/' + NicoID + '" alt="' + NicoTitle + '" title="' + NicoTitle + '">\
NicoData.innerHTML = '\
<object type="text/html" data="http://www.nicovideo.jp/thumb/' + NicoID + '" alt="' + NicoTitle + '" title="' + NicoTitle + '">\
<p><a href="http://www.nicovideo.jp/watch/' + NicoID + '">' + NicoTitle + '</a></p>\
</object>\
';
}else{
NicoData.innerHTML = '\
<iframe width="312" height="176" src="http://www.nicovideo.jp/thumb/' + NicoID + '" scrolling="no" marginheight="0" marginwidth="0" frameborder="0">\
<a href="http://www.nicovideo.jp/watch/' + NicoID + '">' + NicoTitle + '</a>\
</iframe>\
';
}
}
詳しい解説や使い道などはのちほど別記事で。
2008年11月23日 0時更新
| 日 | 月 | 火 | 水 | 木 | 金 | 土 |
|---|---|---|---|---|---|---|
| « 10月 | - | 12月 » | ||||
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | |
