I was recently converting some PrototypeJS code into jQuery, and came across Class.create(), and wasn’t sure of the jQuery equivalent.
Any help?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
jQuery does not ship with this functionality built-in.
If you want to use something with similar syntax to the way PrototypeJS handles it, consider including in your project the tiny Simple JavaScript Inheritance script by John Resig (who is the original author of jQuery).
Once you include that script, you can just copy & paste your code as is. It’s mostly the same. The only difference is that instead of using
Class.create, you should useClass.extend.