手把手教你开发jquery插件(一) 7298棋牌游戏中心
2018-05-30 15:40
作者:admin
jQuery UI has a so-called “unified API” which uses the following syntax
for invoking methods:
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.