以下是从XML读取数据并将其存储在表中的Javascript:
<script>
$(document).ready(function(){
$.ajax({
type: "GET",
url: "pvnxml1.xml",
dataType: "xml",
success: function(xml) {
$(xml).find('row').each(function(){
var Col0 = $(this).find('Col0').text();
var Col1 = $(this).find('Col1').text();
var Col2 = $(this).find('Col2').text();
var Col3 = $(this).find('Col3').text();
var Col4 = $(this).find('Col4').text();
$('<tr></tr>').html('<td>'+Col0+'</td><td>'+Col1+'</td><td>'+Col2+'</td><td>'+Col3+'</td><td>'+Col4+'</td>').appendTo('#chart');
});
}
});
});
</script>
<script language="javascript" type="text/javascript">
setFilterGrid("chart");
// Trying to filter a table and I have used tablefilter.js jQuery to process this
</script>