js小助手

1. js设计模式网址:    http://www.cnblogs.com/Darren_code/archive/2011/08/31/JavascripDesignPatterns.html

2. js是一门基于原型的语言,这意味着对象直接从其他对象继承。    http://js8.in/676.html

3. jQuery闭包,网址:http://sameveryday.blog.163.com/blog/static/17807233720126511038151/    不增加额外的全局变量,执行过程中所有变量都是在匿名函数内部。

4. css选择器的使用:    我写的个人主页留言中css样式的控制可以试试:    $('table.striped > tr:odd').css('background', '#999999');

5. jQuery的强势:   

        $('form#login')        

         // hide all the labels inside the form with the 'optional' class        

        .find('label.optional').hide().end()

        // add a red border to any password fields in the form        

        .find('input:password').css('border', '1px solid red').end()

        // add a submit handler to the form        

        .submit(function(){           

            return confirm('Are you sure you want to submit?');        

        });

 

posted @ 2013-03-22 14:20  海边菩提  阅读(169)  评论(0)    收藏  举报