Didn"t forge 2018-12-09 20:50 采纳率: 25%
浏览 7

使用ajax刷新表

I store some user's data in cookies and then I append all data to the table:

$.ajax({
    url: "http://127.0.0.1:8000/recent/",
    dataType: 'json',
    type: 'get',
    cache:false,
    success: function(data){
        var recent = JSON.parse(data['recent']).reverse();
        $('.container').append(get_table(recent));
    },
    error: function(d){
        alert("404. Please wait until the File is Loaded.");
    }
  });

So my question might be a little bit stupid, but doesn't my table have to be refreshed every time I change data in cookies since I'm getting it using ajax.

  • 写回答

1条回答 默认 最新

  • weixin_33704234 2018-12-09 22:00
    关注

    Nope, it won't refresh everytime you change data in cookies. That's because you only append the first data you received and you saved in cookies.

    If you want to refresh your table everytime you change data in cookies you will need to create a listener that tells you that the data has changed.

    评论

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号