$.each(thedata.data, function() {
$('#theReturnFormTable').append(
'<tr id="newReturn"><td align="center"><a href="##" id="link">'+ this.newrequestor
+'<input type="hidden" id="theID" value="'+ this.theid +'"></a></td><td
align="center">'+ this.newthedate +'</td><td>'+ this.theid +'</td><td
align="center">'+ this.newapproved +'</td>
<td align="center">'+ this.newsecurityaction +'</td></tr>'
);
});
requestor=dave theID = 75
requestor=frank theID = 76
requestor=bill theID = 77
requestor=george theID = 78
requestor=sam theID = 79 and so on.
我的每一行中的鏈接,它抓住theID = 75,無論行我點擊,而不是通過theID的值該行的。我有腦凍結。任何想法如何傳遞每行的ID的值?
這裏就是我通過theID到
$("#link").live("click", function(){
//show layer Div
$("#theHover").show();
alert($("#theID").val());
var instance = new readers_cls();
var theID = $("#theID").val();
newdata = instance.getRequestSecurity(theID);
newrooms = instance.getRequestSecurityRooms(theID);
newcust = instance.getRequestSecurityCust(theID);
我知道它只是下降的頁面,並抓住在HTML中的第一theID。我需要找出解決辦法。
你可以創建一個小提琴嗎? – Celos 2012-04-24 16:02:21
你將最終在文檔中出現重複的「id」。這將導致問題。 – 2012-04-24 16:04:33
從來沒有這樣做 – user1253239 2012-04-24 16:06:09