"Jeopardy" (en.wikipedia.org/wiki/Jeopardy! ) スタイルのゲームを作成しようとしています。私がこの設定を行う方法は、5 x 5 行列または多次元配列です。各配列を反復処理し、値を別の HTML DIV に配置するコードを作成しようとしています。
これが私のコードです:
Jクエリ:
var clues = new Array ();
[0] [0] = "On the world political map, where were some of the major states and empires located about 1500 A.D. (C.E.)?";
[0] [1] = "What were the artistic, literary, and intellectual ideas of the Renaissance?";
[0] [2] = "Where were the five world religions located around 1500 A.D. (C.E.)?";
[0] [3] = "What were the regional trading patterns about 1500 A.D. (C.E.)?";
[0] [4] = "Why were the regional trading patterns important?";
$.each(clues, function(){
$("#rowOne").append('<li>' +value+ '</li>');
('li').on('click','a', function(){
var foo = $(this).text();
$('#clueContainer').text(clues [foo]);
});
});
HTML:
<ul id="rowOne" class="center">
<li><a href="#">$100</a></li>
<li><a href="#">$100</a></li>
<li><a href="#">$100</a></li>
<li><a href="#">$100</a></li>
<li><a href="#">$100</a></li>
</ul>
新しい DIV:
<div id="clueContainer" class="center"></div>
ただし、コードを実行すると、新しい HTML DIV には何も表示されません。
誰か助けてくれませんか?