快速JQuery——(第一章)第一个JQuery

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>

 

 

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>

 

(2.)JQuery 可以弹出两个对话框

ExpandedBlockStart.gif 代码
< 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 >

 

是不是稍稍感觉到 JQuery的强大了呢,那么请继续关注我的博客吧!谢谢您!

转载于:https://www.cnblogs.com/Simcoder/archive/2010/04/21/1717568.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值