答案 0 :(得分:0)
纯JS函数可以(一步一步):
function getDataTable(theButton){
...
var theTD = theButton.parentNode;
var theTR = theTD.parentNode;
var brothers = theTR.childNodes; /* Including the button's td.*/
/* Select a cell, counting from 1 to N.*/
brothers[/*the td-index you want*/].innerHTML = /* the value you want to set.*/
brothers[/*the td-index you want*/].innerHTML; /* or simply get the value it already have.*/
...
/*your AJAX code*/
}
您的按钮应如下所示:
<button onclick="getDataTable(this);">Get data</button>