Blogger Information
Blog 26
fans 0
comment 1
visits 18540
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
PHP课程第十二天之-JQuery的使用方法
Sam徐民强的博客
Original
560 people have browsed it

JQuery是JS一个类库,我们要使用它,必须要先引用,可以直接本地引用也可以在线引用。

一,直接本地引用,需要把jquery.js下载到本地才可以,具体如下:

<script type="text/javascript" src="/scripts/jquery/jquery-1.11.2.min.js"></script>

二、在线引用:就是引用外部公共的文件,

推荐使用百度的静态资源库和bootcss.com的CDN库。

百度:<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>

bootcss:<script src="https://cdn.bootcss.com/jquery/1.9.1/jquery.min.js"></script>


JQuery的使用:

完整写法:

$(document).ready(function(){ 

 alert('Hello JQuery');

})

简写法

$(function(){

alert('Hello JQuery!');

})

Correction status:qualified

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