当前位置:主页 > 新闻 > 业界动态 > 正文

手把手教你开发jquery插件(一) 7298棋牌游戏中心

2018-05-30 15:40 作者:admin

jQuery UI has a so-called “unified API” which uses the following syntax
for invoking methods:

// call select method for tabs $("ul.example").tabs("select", 1);

API methods are called by supplying the method name as a string followed by method arguments. To be honest, I think that this kind API design is fundamentally wrong. It has the following problems:

The syntax is unique to jQuery UI and people outside the UI community are not accustomed to it

The syntax is cubersome. For example, if you want to perform method chaining you have to write the following:$(”ul.example”).tabs(”select”, 1).tabs(”disable”, 2);

The JavaScript engine cannot see typos. writing “selecct” does not look
like an error to a browser, making it harder to debug.

最近关注

热点内容

更多