[Solved] How do I refresh my webpage with Ajax so that I don’t see it loading [closed]


unless i hadnt understand your question (if this is the case, please, be more explicit), what you want is how to make a simple ajax request. I use jquery (i see you tagged this question with jquery). It has a very handy function called $.ajax() it receives a dictionary like this:

$.ajax({
        type: 'POST', // could be 'GET' if you prefer
        url: '/url/of/your/control/script/',
        data: { key1 : val1, key2 : val2 ...}, //dictionary with the data you are sending (if any)
        dataType: 'text', //depends on what you are sending to the server
        success: function(data) {
            // function that is going to be executed if your request is succesfull
            }
        },
        beforeSend: function(){
            // executed before sending the request
          },
        error: function() {
           // executed if the request return an error
        },
        // some other optional fields you can consult in any ajax-jquery tutorial
    });

so, what you have to do is in your success function manipulate your html to refresh just what you want to be refreshed, using the content of data wich should be a dictionary as well…

note that the value for url: is the url of a script, in whatever language you are using, that is going to receive and process the request made by ajax, and return the answer data as a json dictionary or as xml.

also note that this is the syntax of the jquery ajax function… plain javascript may be a little different.

however, i suggest you to read as many tutorials as you can… this is just a pretty plain introduction.

good luck, hope you can use it!

solved How do I refresh my webpage with Ajax so that I don’t see it loading [closed]