如何在 HTML 檔案中新增 jQuery 的 CDN 版本?
直接從內容分發網路 (CDN) 中將 jQuery 庫輕鬆新增到 HTML 程式碼中。Google 和 Microsoft 為最新版本提供內容分發。
您可以嘗試執行以下程式碼來學習如何使用 Google CDN 獲得 jQuery
示例
<html> <head> <title>jQuery CDN</title> <script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ document.write("Tutorialspoint!"); }); </script> </head> <body> <h2>Hello</h2> </body> </html>
廣告