私のコード:
<script type="text/javascript">
window.onload = function () {
$.post("/Game/GetPlayers", function (data) {
for (var i = 0; i < data.player.length; i++) {
if ("@Session.SessionID" == data.player[i].AgainstId);
{
//some code
}
$("<li></li>").text(data.player[i].Name).on("click", function () {
\*when i click - field hide */ $(this).hide();
$.post("/Game/SetId", { name: data.player[i].Name },function(data2) {
alert(data2);
});
}).prependTo("ol");
}
});
}
</script>
クリックするとタグ (li) が消えるのに、2 回目の投稿リクエストが機能しないのはなぜですか? 可能ですか(リクエストインリクエスト)?