发布于 2015-06-11 20:07:46 | 144 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的jQuery示例,程序狗速度看过来!

jQuery javascript框架

jQuery是一个兼容多浏览器的javascript框架,核心理念是write less,do more(写得更少,做得更多)。jQuery在2006年1月由美国人John Resig在纽约的barcamp发布,吸引了来自世界各地的众多JavaScript高手加入,由Dave Methvin率领团队进行开发。


示例代码:

<span style="font-size:14px;">这是jQuery的简单封装,在函数里怎么写,都可以</span>

<span style="font-size:14px;">调用也很简单 </span>

<span style="font-size:14px;">$.ltrim();</span>

<span style="font-size:14px;">$(obj).rtrim(); </span>

<span style="font-size:14px;">
</span>

<span style="font-size:14px;">       $(function () {
            (function ($) {
                $.fn.extend({
                    ltrim: function (txt) {
                        return txt.replace(/^s*/g, "");
                    },
                    rtrim: function (txt) {
                        return txt.replace(/s*$/g, "");
                    }
                });
            })(jQuery);
<span style="white-space:pre">	</span>);</span>




最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务