Javascript 如何在不重新加载页面的情况下刷新内容?

Javascript 如何在不重新加载页面的情况下刷新内容?,javascript,angularjs,Javascript,Angularjs,我必须刷新页面内容,而不必用javascript重新加载页面。 这是行不通的 window.location.assign("#/invoice/" + $scope.invoiceId); 使用AJAX。jQuery为此提供了一个很好的包装器 本例将ajax/test.html加载到您的content div中: $.get('ajax/test.html', function(data) { $("#content").html(data); }); 这可能会对你有所帮助。你

我必须刷新页面内容,而不必用javascript重新加载页面。 这是行不通的

window.location.assign("#/invoice/" + $scope.invoiceId);

使用AJAX。jQuery为此提供了一个很好的包装器

本例将ajax/test.html加载到您的content div中:

$.get('ajax/test.html', function(data) {
     $("#content").html(data);
});

这可能会对你有所帮助。你能更清楚地回答你的问题吗?试试下面的var url='/Candidate/'+newpageIndex$location.path(url);