Enabling refreshing for specific html elements only

后端 未结 4 521
长发绾君心
长发绾君心 2020-12-06 10:08

I would like to know how I can only refresh a specific element in my website, instead of the whole web page? The element I\'m talking about is a flash application that loads

4条回答
  •  -上瘾入骨i
    2020-12-06 10:42

    Try this:

    function reload(){
        var container = document.getElementById("yourDiv");
        var content = container.innerHTML;
        container.innerHTML= content; 
        
       //this line is to watch the result in console , you can remove it later	
        console.log("Refreshed"); 
    }
    Click to Reload
        
    The content that you want to refresh/reload

    Hope it works. Let me know

提交回复
热议问题