Google Hosted Libraries is unnecessarily using cache breakers

后端 未结 1 1739
后悔当初
后悔当初 2021-01-15 02:45

I am using the following code on our dashboard to refresh it constantly without flicker How can I refresh a page with jQuery? :



        
1条回答
  •  礼貌的吻别
    2021-01-15 02:54

    Warning untested:

    $.ajax({
        url: "",
        dataType: "text", //dont parse the html you're going to do it manually
        success: function(html) {
            var $newDoc = $.parseHTML(html, document, false); //false to prevent scripts from being parsed.
            $('body').replaceWith(newDoc.find("body")); //only replace body
        }
    });
    

    A better solution would be to template your body.

    0 讨论(0)
提交回复
热议问题