So I am (still) completely in love with the almighty jQuery, and I have my own growing library of utilities that I want to codify in a java-script object. And I would like to keep syntax similar to that of jquery for the sake of simplicity for my other front end devs. So I want something like this:
foo(argument).method(argument);
我一直在努力这样做:
var foo = function(str){
this.str = str;
}
foo.prototype = {
alertTest : function(additional){
alert(this.str + + additional);
}
}
因此, f( h)al(世界);
我知道这一点是可能的,但我不是一个联络处的幌子,需要帮助获得这一简单的权利。 请提供帮助。 我也打算拥有许多oo().)、bar( like)和 f().)等类型功能。 我曾几次尝试过,但在此艰难挣扎。 还必须有非常严格的办法。
感谢民间!