我有一个包含500个数组的数组。 我希望将这个2D数组显示为一个HTML表格,一次只显示10行。 最初显示前10行。 然后,当用户单击标有 我的想法是认为我 将 我在这里问的问题是,在没有AJAX的情况下可以完成这一切吗? strong> p>
附录: em> strong>如果重要的话,包含数据的2D数组来自MySQL数据库中的表。 p>
div> Next code>的按钮时,前10行将替换为接下来的10行,依此类推。 p>
Next code>按钮指定为Javascript函数,作为其
onclick code>属性的值。 我将首先显示前10行。 然后,当用户单击
Next code>按钮时,将执行JS功能。 在该函数内部,我将不得不使用AJAX来获取2D数组(其中包含要显示的数据),以便我可以显示接下来的10行。 p>
I have an array of 500 arrays. I want to display this 2D array as an HTML table in such a way that only 10 rows are displayed at a time. Initially the first 10 rows are displayed. Then when the user clicks a button labelled Next
, the first 10 rows are replaced by the next 10 rows, and so on.
My mind is thinking that I will assign the Next
button a Javascript function as the value of its onclick
attribute. I will display the first 10 rows initially. Then when the user clicks the Next
button, the JS function is executed. Inside that function, I will have to use AJAX to fetch the 2D array (which contains the data to display), so that I can display the next 10 rows.
The question I am asking here is that is it possible to do this entire thing WITHOUT AJAX?
Addendum: The 2D array containing the data is coming from a table in a MySQL database, if that matters.