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的异步操作及页面重定向跳转


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM