apply & call

function test() {
alert(this.attr(‘href’));
}

var $link = $(‘<a href=”http://www.wikirex.com”>wikirex</a>’);

  • test.apply($link, [‘R’, ‘E’, ‘X’]);
    Output:  http://www.wikirex.com
  • test.call($link, ‘R’, ‘E’, ‘X’);
    Output:  http://www.wikirex.com

One thought on “apply & call

  1. Wonderful website. Lots of useful info here. I am sending it
    to several buddies ans also sharing in delicious.
    And of course, thank you to your sweat!

Comments are closed.