I need to call a function passing argument. Here is my code.
var myfb;
var MyFaceBook = function(response) {
this.response = response;
};
MyFaceBook.prototype.dd = function(_array) {
console.log(_array);
}
MyFaceBook.prototype.doLike = function(_url) {
this.dd(_url);
return false;
}
MyFaceBook.prototype.getTabList = function() {
return '<a href="#" onclick="'+this.doLike.call('http://facebook.com')+'"> Like </a> | <a href="#">Share</a> | <a href="#"> Comment </a>';
};
myfb = new MyFaceBook(response = array());
myfb.getTabList();
What I really need is when I click 'Like' button, I need to console the url i.e 'facebook.com' that I pass.