我一直在尋找這個問題我現在面臨的網絡上..
我無法找到要使用的方式,在我的第二個嵌套循環,我的第一個$(this)。 我想像Php那樣做別名?
有人知道是否有可能嗎?
你可以在下面看到我的代碼來表示問題。
$(".btn-labeled").click(function()
{
var uid = $(this).parent().prev("td").html();
$.get("?what="+uid, function(data) {
var parsedJson = JSON.parse(data);
$(".rule").each(function()
{
var serviceAccount = $(this).children("td").html();
parsedJson.forEach(function(iteration)
{
if(iteration["service_account"] != serviceAccount)
{
//I want this to be attached to first loop :p
$(this).children("td").next("td").children("div").children("input").removeAttr("checked");
}
});
});
});
});
預先感謝
感謝您的回覆,現在很清楚! –