我试图显示从一个表输入到另一个HTML页面的序列化数据。我目前所拥有的是将序列化数据显示为来自JavaScript的警报。(HTML/JavaScript)显示序列化数据到另一个HTML页面
HTML文件中的代码块
<form id="form">
<div class="table-responsive">
<table class="table table-bordered table-striped table-highlight">
<thead class="thead-inverse">
<tr>
<th>Race</th>
<th>Equity Partners</th>
<th>Non-Equity Partners</th>
<th>Associates</th>
<th>Counsel</th>
<th>Other Lawyers</th>
<th>Totals</th>
</tr>
</thead>
<tbody>
<tr>
<td><label>American Indian/Alaska Native</label></td>
<td><input type="text" onkeypress='return event.charCode >= 48 && event.charCode <= 57' class="form-control" name="AmericanIndian_EP" value="" placeholder="Enter Value Here" /></td>
<td><input type="text" onkeypress='return event.charCode >= 48 && event.charCode <= 57' class="form-control" name="AmericanIndian_NEP" value="" placeholder="Enter Value Here" /></td>
<td><input type="text" onkeypress='return event.charCode >= 48 && event.charCode <= 57' class="form-control" name="AmericanIndian_A" value="" placeholder="Enter Value Here" /></td>
<td><input type="text" onkeypress='return event.charCode >= 48 && event.charCode <= 57' class="form-control" name="AmericanIndian1_C" value="" placeholder="Enter Value Here" /></td>
<td><input type="text" onkeypress='return event.charCode >= 48 && event.charCode <= 57' class="form-control" name="AmericanIndian_OL" value="" placeholder="Enter Value Here" /></td>
<td><input type="text" onkeypress='return event.charCode >= 48 && event.charCode <= 57' class="form-control" name="AmericanIndian_T" value="" placeholder="Enter Value Here" /></td>
</tr>
的JavaScript文件中的代码块
$("#btn-ser1").click(function(){
data_array = $("#form").serialize();
alert(data_array);
不能让一个页面上的JavaScript数据显示在另一个页面上。一种选择是通过服务器端脚本页面将'AJAX'数据'POST'到数据库,然后从输出页面上的数据库中检索它。另一种选择是将数据存储在“cookie”或“localStorage”中。 –