$.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>'
);
});
Результатов:JQuery передать уникальный идентификатор без формы
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 для этой строки , У меня замерзли мозг. Любые идеи, как передать значение идентификатора для каждой строки?
Вот где я прохожу 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);
Я знаю, что он просто идет вниз страницы и захватывает первый theID в HTML. Мне нужно разобраться в этом.
Не могли бы вы создать скрипку? – Celos
В конце вы получите дубликат 'id' в документе. Это вызовет проблемы. –
никогда не делал этого – user1253239