私のjs関数で私は以下を持っていました
success: function (result) {
$.each(result, function (i, item) {
$("#tab-" + item.myType).append(result);
})
}
今、私はこの関数を変更し、代わりに私は以下を持っています
success: function (result) {
$("#tab-how To Access to the first result collection element ").html(result);
}
}
で試してみました
$("#tab-" + result[0].item.myType).html(result);
しかし、それは役に立ちませんでした。
質問は次のとおりです。結果コレクションオブジェクト内の最初のjs要素にアクセスする方法
何かご意見は ?
console.log(result)を使用して、部分ビューで表示するhtmlスニペットを取得しています
div class="product clearfix">
<div class="l-new">
<a href="#">
@Model.MyType (rendered as My Type)
</a>
....
</div>