Reputation: 1055
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?
Upvotes: 0
Views: 5667
Reputation: 28645
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);
}
});
Upvotes: 5