Ajax技术实现页面无刷新跳转

Ajax实现无刷新显示新的页面

 1 <!DOCTYPE html>
 2 <html>
 3 <head>
 4 <script src="/jquery/jquery-1.11.1.min.js">
 5 </script>
 6 <script>
 7 $(document).ready(function(){
 8   $("#btn1").click(function(){
 9     $('#test').load('/example/jquery/demo_test.txt');
10   })
11 })
12 </script>
13 </head>
14 
15 <body>
16 
17 <h3 id="test">请点击下面的按钮,通过 jQuery AJAX 改变这段文本。</h3>
18 <button id="btn1" type="button">获得外部的内容</button>
19 
20 </body>
21 </html>

参考:

jQuery ajax - load() 方法

ajax的异步操作及页面重定向跳转

原文地址:https://www.cnblogs.com/WhiteM/p/7146800.html