1.刷新当前页面
window.location.reload();
2,局部刷新:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script src="http://cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script> </head> <body> <div class="refresh"> 1111111111111111111 1111111111111111111 1111111111111111111 </div> <div> <!--不刷新这边的内容--> 22222222222222222222 </div> <input type="button" value="刷新"/> </body> </html> <script type="text/javascript"> $(function(){ //定时刷新 // setInterval(function () { $(".refresh").load(location.href + " .refresh"); }, 5000); $("input").click(function () { $(".refresh").load(location.href + " .refresh"); }) }) </script>