Javascript 从头重新加载Dom,而不重新加载页面

Javascript 从头重新加载Dom,而不重新加载页面,javascript,Javascript,是否可以像按重新加载按钮一样重新加载页面,而不实际按重新加载按钮 //example.com is the page that contains following function function refreshPage() { $("html").html(""); $.get( "https://example.com", function( data ) { $("body")

是否可以像按重新加载按钮一样重新加载页面,而不实际按重新加载按钮

//example.com is the page that contains following function

function refreshPage()
{
    $("html").html("");
    $.get( "https://example.com", function( data ) {
      $("body").html( data );
    });
}
我试过上面的方法,这是正确的方法吗?多谢各位