i was wondering what prototype means in jQuery? i usually find infos about "Prototype" - the framework - but here it's "prototype" inside jQuery...? Could you please tell me when it's best to use it?
Also, could you tell me : why do we use a "plain javascript" code inside a jQuery plugin, instead of the jquery code, like in this example? is it a rapidity issue?
here's my example : (a plugin for twitter)
Thanks for your answers !
$.each(data, function(i, item) {
holder.append("<p>"+item.text.makeLinks()+"</p>");
});
//...further in the code
String.prototype.makeLinks = function() {
return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/, function(str) {
return str.link(str);
});
};