Blogger Information
Blog 4
fans 0
comment 0
visits 2478
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
jqurey的引入方式
A微信视频直播衡阳微生活的博客
Original
803 people have browsed it

jQuery 二种引入方式,一种是CDN引用,如下

实例

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>jquery的二种引入方式</title>
    <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script>
//    window.onload:在页面元素全部加载完后自动调用的事件 ===$(document).ready(function(){})
//   $(document).ready(function(){})的简写 $(function () {})
        $(function () {
            $('h2').css('background','blue')
        })
    </script>
   
</head>
<body>
    <h2>jQuery使用cdn在线引用)</h2>
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

一种是本地引用,事先把jq类库下载到本地电脑,如下

实例

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>jquery的二种引入方式</title>
    <script src="../jquery.min.js"></script>
    <script>
//    window.onload:在页面元素全部加载完后自动调用的事件 ===$(document).ready(function(){})
//   $(document).ready(function(){})的简写 $(function () {})
        $(function () {
            $('h2').css('background','blue')
        })
    </script>
   
</head>
<body>
    <h2>jQuery本地引用)</h2>
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例


Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post