如何加载从数据库(MySQL的)更新数据,而无需刷新页面? [英] How to load updated data from database(mysql) without refresh the page?

查看:152
本文介绍了如何加载从数据库(MySQL的)更新数据,而无需刷新页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要显示从数据库中的数据到一个页面。 我使用AJAX和PHP。 但是,是不是即将到来的新的更新数据。 如果我刷新页面,则显示出新的更新数据。 请给我说说,或一些链接,例如一些想法。

I want to show the data from database into a page. I am using AJAX and PHP. But there is not coming new updates data. If i refresh the page, then it is showing new updates data. Please give me some idea about it or some links for example.

由于事先大家。

推荐答案

有两点原因为,要么缓存或你的控制不会等到你的Ajax响应回来。 试试这个:

There is two reason for that either cache or your control will not wait until your response of ajax is come back. try this:

$.ajax({
    type: "POST",
    url: "<your file url>",
    data: {<arguments>},
    cache: false,
    async:false,
    success: function(data) {

    } 
});

这篇关于如何加载从数据库(MySQL的)更新数据,而无需刷新页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆