(Jquery,mootools,dojo) name _jquery using the appropriate programming alias

Source: Internet
Author: User
Tags mootools
In jquery, for example, you can often see the following code
Copy Code code as follows:

(function ($) {
Some code
}) (JQuery)

So you can use $ to replace jquery;

You can write this in MooTools, because in MooTools, $$ represents a collection.

Copy Code code as follows:

(function ($) {
Do sth.
}) (Document.ID)

You can write that in dojo.
Copy Code code as follows:

(function (d,$) {
}) (Dojo,dojo.query)

In this way you can use $ instead of dojo.query in dojo, and implement a quick transformation from jquery to dojo;
Also imitate MooTools, you can write that.
Copy Code code as follows:

(function (d,$,$$) {
do sth;
}) (Dojo.dojo.byid,dojo.query)

This way you can use $ instead of dojo. Byid, using $$ instead of dojo.query;
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.