경고가 작동하지 않는 이유를 누구든지 볼 수 있습니까? http://api.jquery.com/live/ :jquery anchor가 작동하지 않음
<table class="result-table pending-accept">
<thead class="bottom-align">
<tr>
<th>Code</th>
<th>Source</th>
<th>Last Transmitted</th>
<th>Last Staged</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var trans in processItems)
{
<tr>
<td class="autosize"><div>@trans.Code</div></td>
<td class="autosize"><div>@trans.Description</div></td>
<td class="autosize"><div>@(trans.HasBeenLoadedToVault ? trans.VaultLoadDt.ToString() : "")</div></td>
<td class="autosize"><div>@trans.StageLoadDt</div></td> @* <td class="autosize"><div><a href="@Url.Action("Accept", new { id = trans.Id,loadSource = trans.LoadSource})" class="button grid-sized">Accept</a></div></td>*@
<td class="autosize"><div><a href="#" data-id="@trans.Id" data-loadSource="@trans.LoadSource" class="button grid-sized acceptButton">Accept</a></div></td>
</tr>
}
</tbody>
</table>
<script type="text/javascript">
$(document).ready(function() {
$(".pending-accept a").live('click',function (e) {
e.preventDefault();
alert('Clicked!');
return false;
});
});
</script>
편집 이것은 jQuery를에 라이브 기능이 지원되지 않습니다
$(document).on('click', '.pending-accept a', function (e) {
e.preventDefault();
alert('Clicked!');
return false;
});
해결책을 질문에 대한 편집이 아닌 답변으로 게시하십시오. – ChrisF
콘텐츠가 이전에 추가 되었기 때문에 작동했다면 정보가 검색하기가 어려웠습니다. – Jorge