How do I refresh a DIV content?

后端 未结 4 743
故里飘歌
故里飘歌 2020-12-13 14:15

I am trying to refresh a certain div within a bunch of divs. The div content is basically generated by PHP alon

4条回答
  •  情书的邮戳
    2020-12-13 14:55

    To reload a section of the page, you could use jquerys load with the current url and specify the fragment you need, which would be the same element that load is called on, in this case #here:

    function updateDiv()
    { 
        $( "#here" ).load(window.location.href + " #here" );
    }
    

    This function can be called within an interval, or attached to a click event

提交回复
热议问题