我有一个非常大的HTML表,其数据格式如下(表的简化版):https://pastebin.com/K5UB4cGB列表更大。我需要知道哪个应用程序在哪个Server(多个)上运行。现在,我需要以某种方式获取所有数据并将其存储(也许以数组的形式),以便可以使用它。(例如,我需要比较某些应用程序并编写代码来对其进行记录。)我已经尝试了很多在网络上找到的方法,但是我不确定即时通讯方式是否正确。我最近的免税额是:var data = Array();$("table").each(function(i, v) { data[i] = Array(); $(this).each(function(ii, vv) { data[i][ii] = $(this).text(); });})document.write(data);<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><table id="table"> <tr> <th>1</th> <th>2</th> <th>3</th> </tr> <tr> <td>4</td> <td>5</td> <td>6</td> </tr> <tr> <td>7</td> <td>8</td> <td>9</td> </tr></table><div id="result" style="color: #f00"></div>输出:1 2 3 4 6 7 8 9 10通过这种方法,我得到一个数组:1,2,3,4,5,6,7,8,9,10但是我无法访问存储的值,因为例如data [0]输出所有值,而不仅仅是输出一个。抱歉,长文本谢谢你的帮助 :)
添加回答
举报
0/150
提交
取消