开发者

Alternate of prototype Class.create();

开发者 https://www.devze.com 2023-03-25 03:38 出处:网络
is there an alternate of Class.create(); of Prototype.js, i have found a code to call SOAP Webservice and return javascript object and i want to implement that in to my mobile website but 开发者_Stack

is there an alternate of Class.create(); of Prototype.js, i have found a code to call SOAP Webservice and return javascript object and i want to implement that in to my mobile website but 开发者_StackOverflowdon't want to use prototype because i m using Zepto and Backbone


You should check out this: Simple JavaScript Inheritance by John Resig. He has another blog on class instantiation which has good explanation on this topic: Simple "Class" Instantiation.

Also, check out this post on JavaScript inheritance: Is there a better way to create an object-oriented class with jquery?


There are many, many libraries that provide syntactic sugar to create new object types in javascript. My favorite is my.class. But if you want to call a SOAP web service, that has next to no relation to defining a class. It's entirely possible that you don't want a class at all:

  • Will there only be one instance? use an object literal.
  • Is the only difference what DOM elements will be acted upon? Perhaps a jQuery plugin is a better fit. (Zepto tries to be API-compatible with jQuery.)
0

精彩评论

暂无评论...
验证码 换一张
取 消