Ajax - How refresh
after submit

前端 未结 5 1364
时光说笑
时光说笑 2020-11-30 10:57

How can I refresh just part of the page (\"DIV\") after my application releases a submit? I\'m use JQuery with plugin ajaxForm. I set my target with \"divResult\", but the p

5条回答
  •  遥遥无期
    2020-11-30 11:24

    Using jQuery, sometimes when I perform a .get ajax call to update a database, I reload/refresh another part of the page using a simple jQuery .load statement in the success callback function to replace the contents of a div.

    $("#div_to_refresh").load("url_of_current_page.html #div_to_refresh")
    

    I'd like to note that this is not the most efficient way to reload a small portion of data, and thus I would only use it on a low traffic web app, but it is simple to code.

提交回复
热议问题