简体   繁体   English

如何刷新内容而不重新加载页面?

[英]How to refresh the contents without reloading page?

I have to refresh the contents of page without reloading the page in javascript. 我必须刷新页面内容,而无需在javascript中重新加载页面。 This is not working. 这是行不通的。

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

Use AJAX. 使用AJAX。 jQuery provides a nice wrapper for that. jQuery为此提供了一个很好的包装器。

http://jQuery.com/ http://jQuery.com/

This example loads ajax/test.html into you #content div: 此示例将ajax / test.html加载到您的#content div中:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM