直接从Content Delivery Network(CDN)轻松将jQuery库包含到HTML代码中。Google和Microsoft提供最新版本的内容交付。
您可以尝试运行以下代码,以了解如何将Google CDN用于jQuery:
<html>
<head>
<title>jQuery CDN</title>
<script src = "https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
document.write("Nhooo!");
});
</script>
</head>
<body>
<h2>Hello</h2>
</body>
</html>