jQuery的$.fn.extend和$.extend使用

<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>

获致幸福的不二法门是珍视你所拥有的、遗忘你所没有的

jQuery的$.fn.extend和$.extend使用

相关文章:

你感兴趣的文章:

标签云: