Ich habe eine Anwendung (Spring 4 MVC + Hibernate 4 + MySQL + Maven Integration Beispiel mit Anmerkungen), und JQuery, ich möchte eine Funktion aufrufen, wenn der Benutzer auf eine Reihe mit Official jQuery Benutzeroberfläche Bibliothek klickt , aber es funktioniert nichtJQuery Klicken Sie auf Tabelle
<script type="text/javascript">
$('#productResultTable').delegate("tr", "click", function() {
alert ('productResultTable');
var id = $(this).attr("id");
if (id != undefined) {
document.getElementById('itemId').value=id;
showItem (id);
}
});
</script>
<table cellspacing="0" cellpadding="0" border="0" id="productResultTable" class="table table-striped">
<thead>
<tr>
<th width="10%">
Licence No. <span class="ui-icon-triangle-1-n"></span>
<input class="form-control" type="text" />
</th>
<th width="25%">
Product name <span class="ui-icon-triangle-1-n"></span>
<input class="form-control" type="text" />
</th>
<th class="notinmobile">
Category <span class="ui-icon-triangle-1-n"></span>
<input class="form-control" type="text" />
</th>
<th class="notinmobile">
Manufacturer <span class="ui-icon-triangle-1-n"></span>
<input class="form-control" type="text" />
</th>
<th class="notinmobile">
Country(ies) <span class="ui-icon-triangle-1-n"></span>
<input class="form-control" type="text" />
</th>
<th class="notinmobile">
Retailer(s) <span class="ui-icon-triangle-1-n"></span>
<input class="form-control" type="text" />
</th>
</tr>
</thead>
<tbody>
<tr id="915447" class="odd">
<td>ES-LR-017-001</td>
<td><img src="images/bedmattress1.jpg"/>3-delt Rejse Helsemadras 60*120, varenummer 691738</td>
<td class="notinmobile">bed mattresses</td>
<td class="notinmobile">Carpenter ApS</td>
<td class="notinmobile">Denmark </td>
<td class="notinmobile">Carpenter aps</td>
</tr>
</tbody>
<tfoot>
<tr style="border-top:1px solid #336699;">
<th>
License No.
</th>
<th>
Product name
</th>
<th class="notinmobile">
Category
</th>
<th class="notinmobile">
Manufacturer
</th>
<th class="notinmobile">
Country(ies)
</th>
<th class="notinmobile">
Retailer(s)
</th>
</tr>
</tfoot>
</table>
gegeben, oder setzen Sie den 'script'-Tag am Ende des HTML, kurz vor dem' '