谁能看到为什么警报不起作用?
<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>
编辑这工作
$(document).on('click', '.pending-accept a', function (e) {
e.preventDefault();
alert('Clicked!');
return false;
});