Im trying to reload JUST a table on a page [Ajax it a bit confusing]
var table = document.getElementById ("table");
table.refresh();
Would that have the same results as using ajax to reload the table?
There is no such JavaScript method. You are going to have to learn how to use Ajax.
You may want to look into using jQuery and its ajax() method. jQuery makes Ajax much easier to understand. Here is an example of jquery's ajax method.
$.ajax({
type: "POST",
url: "pathToPage",
data: "yourParamsToGetData",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (result) {
FillTableFromResults(result);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
if (errorThrown != null)
alert(textStatus + " : " + errorThrown);
}
});
refresh()on a table element in plain DOM. How would your table element know where to get its data? What is the source of the data? Do you need to pull it from a database? There would be no other way than AJAX to refresh your table with new data, as you probably need to do some server side processing. What technologies are you using?