William Jiang

JavaScript,PHP,Node,Perl,LAMP Web Developer – http://williamjxj.com; https://github.com/williamjxj?tab=repositories

Some js examples tested in FF console

Some js examples tested in FF console

Here I list some of my js function examples which I tested in FF console for quick retrieve:

;(function($) {
 $y = {
   b: function() {
    console.log('bbb');
   },
   c: 'ccc'
 };
})(jQuery);

(function($) {
 $.fn.extend({
   a: function() {
    console.log('aaa');
   }
 });
})(jQuery);

(function($) {
  $.extend({
    t: function() {
      console.log('ttt');
    }
  });
})(jQuery);

$(document.body).a();
$y.b();
console.log($y.c);
$.t();

function aa() {
  var x=function() {
   console.log('111');
  }
  x();
}
var bb = function() {
  console.log('222');
}

cc=aa;
console.log(cc===aa);
cc();
dd=bb;
console.log(dd===bb);
dd();

They are interesting, but very common in real-life.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: