1.JQuery下载地址:http://docs.jquery.com/Downloading_jQuery
2.http://code.jquery.com/jquery-1.4.2.min.js 压缩开发版
http://code.jquery.com/jquery-1.4.2.js 自学调试版 (先都下载下来)
3.使用Dreamweaver编写第一个JQuery
< script src = " jquery-1.4.2.js " type = " text/javascript " >< / script> <!-- 导入JQuery -->
< script type = " text/javascript " >
$(document).ready( function (){
alert( " HelloWorld! " );
});
< / script>
这个程序就是常用的 弹出对话框 !学程序 HelloWorld 开始先!
4. $ 就是JQuery的简写形式
以上程序还可以简写成为:
<
script type
=
"
text/javascript
"
>
$( function (){
alert( " 代码变少了! " );
})
< / script>
$( function (){
alert( " 代码变少了! " );
})
< / script>
5.JQuert 的 $(document).ready 与JavaScript window.load 的不同:
(1.)JavaScript,不会同时弹出两个对话框,只能弹出最后一个:
<!--
普通的JS
-->
< script type = " text/javascript " >
window.onload = function (){
alert( " 对话框 1 " );
}
< / script>
< script type = " text/javascript " >
window.onload = function (){
alert( " 对话框 2 " );
}
< / script>
< script type = " text/javascript " >
window.onload = function (){
alert( " 对话框 1 " );
}
< / script>
< script type = " text/javascript " >
window.onload = function (){
alert( " 对话框 2 " );
}
< / script>
(2.)JQuery 可以弹出两个对话框
代码
<
script src
=
"
jquery-1.4.2.js
"
type
=
"
text/javascript
"
></
script
>
<!--
导入JQuery
-->
< script type = " text/javascript " >
$(document).ready(function(){
alert( " HelloWorld! " );
});
</ script >
< script type = " text/javascript " >
$(function(){
alert( " 代码变少了! " );
})
</ script >
< script type = " text/javascript " >
$(document).ready(function(){
alert( " HelloWorld! " );
});
</ script >
< script type = " text/javascript " >
$(function(){
alert( " 代码变少了! " );
})
</ script >
是不是稍稍感觉到 JQuery的强大了呢,那么请继续关注我的博客吧!谢谢您!