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