0

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?

8
  • 1
    There is no such method 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? Commented Jun 20, 2012 at 20:51
  • Sorry, but you can't do this without ajax Commented Jun 20, 2012 at 20:51
  • Wow, I came across a site that said there was one. Ill make sure not to go there again Commented Jun 20, 2012 at 20:52
  • Cory, help.dottoro.com/ljpoljcl.php Commented Jun 20, 2012 at 20:54
  • 2
    @Alex: This seems to be some old proprietary Microsoft extension (see how it is only supported in IE?). Anyways, as the description says, this is for refreshing the style of a table, after you changed CSS rules. This has nothing to do with Ajax. Commented Jun 20, 2012 at 20:57

1 Answer 1

5

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);
    }
});
Sign up to request clarification or add additional context in comments.

2 Comments

I'm certainly not recommending iframes for this, but you could use an iframe to do this right? I'm still right there with you that ajax is the way to go. Maybe show a quick example for the OP?
@lbstr I have updated my answer. FYI, you could use an iframe for this, but ajax is definitely the right way to go here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.